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

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

diff --git a/app/assets/javascripts/discourse/app/initializers/edit-notification-clicks-tracker.js b/app/assets/javascripts/discourse/app/initializers/edit-notification-clicks-tracker.js
index c9e2914..8146c40 100644
--- a/app/assets/javascripts/discourse/app/initializers/edit-notification-clicks-tracker.js
+++ b/app/assets/javascripts/discourse/app/initializers/edit-notification-clicks-tracker.js
@@ -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);
   },
 };

GitHub sha: 8bb911e038cc626016a6cf0e988d7608ab7ea5d3

This commit appears in #14745 which was approved by CvX and jjaffeux. It was merged by davidtaylorhq.