Merge pull request #4475 from xfalcox/last-visit-adjusts
FIX: Last visit must keep working when changing categories
This commit is contained in:
commit
baecaddef0
|
@ -33,6 +33,9 @@ export default Ember.Component.extend({
|
||||||
|
|
||||||
@computed('topics.@each', 'order', 'ascending')
|
@computed('topics.@each', 'order', 'ascending')
|
||||||
lastVisitedTopic(topics, order, ascending) {
|
lastVisitedTopic(topics, order, ascending) {
|
||||||
|
|
||||||
|
this._cleanLastVisitedTopic();
|
||||||
|
|
||||||
if (!this.get('highlightLastVisited')) { return; }
|
if (!this.get('highlightLastVisited')) { return; }
|
||||||
if (order !== "default" && order !== "activity") { return; }
|
if (order !== "default" && order !== "activity") { return; }
|
||||||
if (!topics || topics.length === 1) { return; }
|
if (!topics || topics.length === 1) { return; }
|
||||||
|
@ -85,7 +88,6 @@ export default Ember.Component.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
@observes('category')
|
@observes('category')
|
||||||
@on('willDestroyElement')
|
|
||||||
_cleanLastVisitedTopic() {
|
_cleanLastVisitedTopic() {
|
||||||
const prevTopic = this.get('prevTopic');
|
const prevTopic = this.get('prevTopic');
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue