mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-30 10:58:31 -05:00
Only display in discovery, correct double highlighting
This commit is contained in:
parent
11f9a463ac
commit
9b1e81cd6d
2 changed files with 15 additions and 2 deletions
|
@ -33,13 +33,20 @@ export default Ember.Component.extend({
|
|||
|
||||
@computed('topics.@each')
|
||||
lastVisitedTopic() {
|
||||
if (!this.get('highlightLastVisited')) { return; }
|
||||
|
||||
let user = Discourse.User.current();
|
||||
if (!user || !user.previous_visit_at) {
|
||||
return;
|
||||
}
|
||||
|
||||
let prevVisit = user.get('previousVisitAt');
|
||||
let prevTopic, topic;
|
||||
prevTopic = this.get('prevTopic');
|
||||
if (prevTopic) {
|
||||
return prevTopic;
|
||||
}
|
||||
|
||||
let prevVisit = user.get('previousVisitAt');
|
||||
let skipPinned = true;
|
||||
|
||||
this.get('topics').any(t => {
|
||||
|
@ -53,11 +60,16 @@ export default Ember.Component.extend({
|
|||
return t.get('bumpedAt') < prevVisit;
|
||||
});
|
||||
|
||||
|
||||
if (!prevTopic || !topic) {
|
||||
return;
|
||||
}
|
||||
|
||||
// end of list that was scanned
|
||||
if (topic.get('bumpedAt') > prevVisit) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.set('prevTopic', prevTopic);
|
||||
return prevTopic;
|
||||
},
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
|
||||
{{#if hasTopics}}
|
||||
{{topic-list
|
||||
highlightLastVisited=true
|
||||
showTopicPostBadges=showTopicPostBadges
|
||||
showPosters=true
|
||||
currentUser=currentUser
|
||||
|
|
Loading…
Reference in a new issue