diff --git a/app/assets/javascripts/discourse/controllers/discovery_topics_controller.js b/app/assets/javascripts/discourse/controllers/discovery_topics_controller.js index 6e5d94bfa92..c15fee204ef 100644 --- a/app/assets/javascripts/discourse/controllers/discovery_topics_controller.js +++ b/app/assets/javascripts/discourse/controllers/discovery_topics_controller.js @@ -81,7 +81,16 @@ Discourse.DiscoveryTopicsController = Discourse.DiscoveryController.extend({ } else { promise = Discourse.Topic.bulkOperationByFilter(this.get('filter'), operation); } - promise.then(function() { self.send('refresh'); }); + promise.then(function(result) { + if (result && result.topic_ids) { + var tracker = Discourse.TopicTrackingState.current(); + result.topic_ids.forEach(function(t) { + tracker.removeTopic(t); + }); + tracker.incrementMessageCount(); + } + self.send('refresh'); + }); } }, diff --git a/app/assets/javascripts/discourse/models/topic_tracking_state.js b/app/assets/javascripts/discourse/models/topic_tracking_state.js index f1283bba9fb..19d6a4dd693 100644 --- a/app/assets/javascripts/discourse/models/topic_tracking_state.js +++ b/app/assets/javascripts/discourse/models/topic_tracking_state.js @@ -5,7 +5,6 @@ Discourse.TopicTrackingState = Discourse.Model.extend({ this._super(); this.unreadSequence = []; this.newSequence = []; - this.states = {}; }, @@ -13,7 +12,6 @@ Discourse.TopicTrackingState = Discourse.Model.extend({ var tracker = this; var process = function(data){ - if (data.message_type === "delete") { tracker.removeTopic(data.topic_id); tracker.incrementMessageCount(); @@ -28,7 +26,6 @@ Discourse.TopicTrackingState = Discourse.Model.extend({ tracker.incrementMessageCount(); } } - }; Discourse.MessageBus.subscribe("/new", process);