FIX: Stop incoming message tracking after navigating away. (#14498)

FIX: Stop incoming message tracking after navigating away. (#14498)

diff --git a/app/assets/javascripts/discourse/app/controllers/user-topics-list.js b/app/assets/javascripts/discourse/app/controllers/user-topics-list.js
index c884703..ab93870 100644
--- a/app/assets/javascripts/discourse/app/controllers/user-topics-list.js
+++ b/app/assets/javascripts/discourse/app/controllers/user-topics-list.js
@@ -49,7 +49,7 @@ export default Controller.extend(BulkTopicSelection, {
   },
 
   unsubscribe() {
-    this.pmTopicTrackingState.resetIncomingTracking();
+    this.pmTopicTrackingState.stopIncomingTracking();
   },
 
   @action
diff --git a/app/assets/javascripts/discourse/app/models/private-message-topic-tracking-state.js b/app/assets/javascripts/discourse/app/models/private-message-topic-tracking-state.js
index b5aee27..3080a99 100644
--- a/app/assets/javascripts/discourse/app/models/private-message-topic-tracking-state.js
+++ b/app/assets/javascripts/discourse/app/models/private-message-topic-tracking-state.js
@@ -81,6 +81,17 @@ const PrivateMessageTopicTrackingState = EmberObject.extend({
     }
   },
 
+  stopIncomingTracking() {
+    if (this.inbox) {
+      this.setProperties({
+        newIncoming: [],
+        inbox: null,
+        filter: null,
+        activeGroup: null,
+      });
+    }
+  },
+
   removeTopics(topicIds) {
     if (!this.isTracking) {
       return;

GitHub sha: d82e5cd37c1c3b2377507ed0354bbdce6a96ae99

This commit appears in #14498 which was approved by OsamaSayegh. It was merged by tgxworld.