From 5476dee52d8628df5ac5fa317a355a6eb2208b13 Mon Sep 17 00:00:00 2001 From: Rafael dos Santos Silva Date: Thu, 29 Sep 2016 17:40:28 -0300 Subject: [PATCH] FIX: Last visit must keep working when changing categories --- app/assets/javascripts/discourse/components/topic-list.js.es6 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/components/topic-list.js.es6 b/app/assets/javascripts/discourse/components/topic-list.js.es6 index 0c0b220d058..79eb86b7ea2 100644 --- a/app/assets/javascripts/discourse/components/topic-list.js.es6 +++ b/app/assets/javascripts/discourse/components/topic-list.js.es6 @@ -33,6 +33,9 @@ export default Ember.Component.extend({ @computed('topics.@each', 'order', 'ascending') lastVisitedTopic(topics, order, ascending) { + + this._cleanLastVisitedTopic(); + if (!this.get('highlightLastVisited')) { return; } if (order !== "default" && order !== "activity") { return; } if (!topics || topics.length === 1) { return; } @@ -85,7 +88,6 @@ export default Ember.Component.extend({ }, @observes('category') - @on('willDestroyElement') _cleanLastVisitedTopic() { const prevTopic = this.get('prevTopic');