A platform for community discussion. Free, open, simple.
PERF: Remove request for PM topic tracking state initiated from sidebar (#20554)
Alan Guo Xiang Tan5e0c95ed838c
diff --git a/app/assets/javascripts/discourse/app/components/sidebar/user/messages-section.js b/app/assets/javascripts/discourse/app/components/sidebar/user/messages-section.jsindex af421985fdd..5747b39d69b 100644--- a/app/assets/javascripts/discourse/app/components/sidebar/user/messages-section.js+++ b/app/assets/javascripts/discourse/app/components/sidebar/user/messages-section.js@@ -38,10 +38,6 @@ export default class SidebarUserMessagesSection extends Component {this._refreshSectionLinksDisplayState);- this.pmTopicTrackingState- .startTracking()- .then(this._refreshSectionLinkCounts);-this._pmTopicTrackingStateKey = "messages-section";this.pmTopicTrackingState.onStateChange(diff --git a/app/assets/javascripts/discourse/tests/acceptance/sidebar-user-messages-section-test.js b/app/assets/javascripts/discourse/tests/acceptance/sidebar-user-messages-section-test.jsindex 6ae22561611..f9629d6c78c 100644--- a/app/assets/javascripts/discourse/tests/acceptance/sidebar-user-messages-section-test.js+++ b/app/assets/javascripts/discourse/tests/acceptance/sidebar-user-messages-section-test.js@@ -376,6 +376,10 @@ acceptance("service:pm-topic-tracking-state");+ await click(+ ".sidebar-section-messages .sidebar-section-link-group-messages-inbox.group1"+ );+await publishToMessageBus(pmTopicTrackingState.groupChannel(1), {topic_id: 1,message_type: "unread",@@ -398,10 +402,6 @@ acceptance(},});- await click(- ".sidebar-section-messages .sidebar-section-link-group-messages-inbox.group1"- );-assert.strictEqual(query(".sidebar-section-messages .sidebar-section-link-group-messages-unread.group1"@@ -449,6 +449,10 @@ acceptance("service:pm-topic-tracking-state");+ await click(+ ".sidebar-section-messages .sidebar-section-link-personal-messages-inbox"+ );+await publishToMessageBus(pmTopicTrackingState.userChannel(), {topic_id: 1,message_type: "unread",@@ -460,10 +464,6 @@ acceptance(},});- await click(- ".sidebar-section-messages .sidebar-section-link-personal-messages-inbox"- );-assert.strictEqual(query(".sidebar-section-messages .sidebar-section-link-personal-messages-unread"