DEV: Teardown appEvent listener in edit-notification-clicks-tracker

This commit is contained in:
David Taylor 2021-10-27 17:49:23 +01:00
parent 8af0674b68
commit 8bb911e038
1 changed files with 10 additions and 8 deletions

View File

@ -4,13 +4,15 @@ export default {
name: "edit-notification-clicks-tracker",
initialize(container) {
container
.lookup("service:app-events")
.on(
"edit-notification:clicked",
({ topicId, postNumber, revisionNumber }) => {
setLastEditNotificationClick(topicId, postNumber, revisionNumber);
}
);
this.appEvents = container.lookup("service:app-events");
this.appEvents.on("edit-notification:clicked", this, this.handleClick);
},
handleClick({ topicId, postNumber, revisionNumber }) {
setLastEditNotificationClick(topicId, postNumber, revisionNumber);
},
teardown() {
this.appEvents.off("edit-notification:clicked", this, this.handleClick);
},
};