From 0b8177de54c1834ab56a005c7b2f7211ebed1a6d Mon Sep 17 00:00:00 2001 From: Alan Guo Xiang Tan Date: Wed, 25 May 2022 11:28:57 +0800 Subject: [PATCH] DEV: Remove unnecessary logic in TopicTrackingState on the client side (#16900) There is no need for the extra protection on the client side if there is a bug on the server side. In fact, we want the bug to be surfaced so that it can be fixed on the server side. --- .../discourse/app/models/topic-tracking-state.js | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/app/assets/javascripts/discourse/app/models/topic-tracking-state.js b/app/assets/javascripts/discourse/app/models/topic-tracking-state.js index 050d0247ebf..b6a7cd5c992 100644 --- a/app/assets/javascripts/discourse/app/models/topic-tracking-state.js +++ b/app/assets/javascripts/discourse/app/models/topic-tracking-state.js @@ -189,9 +189,6 @@ const TopicTrackingState = EmberObject.extend({ if (!this.newIncoming) { return; } - if (data.payload && data.payload.archetype === "private_message") { - return; - } const filter = this.filter; const filterCategory = this.filterCategory; @@ -482,8 +479,6 @@ const TopicTrackingState = EmberObject.extend({ return Array.from(this.states.values()).filter( (topic) => filterFn(topic) && - topic.archetype !== "private_message" && - !topic.deleted && (!categoryId || subcategoryIds.has(topic.category_id)) && (!tagId || (topic.tags && topic.tags.indexOf(tagId) > -1)) && (type !== "new" || @@ -863,12 +858,10 @@ const TopicTrackingState = EmberObject.extend({ _trackedTopics(opts = {}) { return Array.from(this.states.values()) .map((topic) => { - if (topic.archetype !== "private_message" && !topic.deleted) { - let newTopic = isNew(topic); - let unreadTopic = isUnread(topic); - if (newTopic || unreadTopic || opts.includeAll) { - return { topic, newTopic, unreadTopic }; - } + let newTopic = isNew(topic); + let unreadTopic = isUnread(topic); + if (newTopic || unreadTopic || opts.includeAll) { + return { topic, newTopic, unreadTopic }; } }) .compact();