mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-18 03:25:31 -05:00
FIX: topic.lastPoster should be based on the 'latest' extra
This commit is contained in:
parent
1906b99d1f
commit
7ced16acbf
1 changed files with 4 additions and 9 deletions
|
@ -13,15 +13,10 @@ const Topic = RestModel.extend({
|
||||||
return poster && poster.user;
|
return poster && poster.user;
|
||||||
},
|
},
|
||||||
|
|
||||||
@computed('posters.lastObject')
|
@computed('posters.@each')
|
||||||
lastPoster(poster) {
|
lastPoster(posters) {
|
||||||
if (poster){
|
const latest = posters.filter(p => p.extras && p.extras.indexOf("latest") >= 0)[0];
|
||||||
if (this.last_poster_username === poster.user.username){
|
return latest.user;
|
||||||
return poster.user;
|
|
||||||
} else {
|
|
||||||
return this.get('creator');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
@computed('fancy_title')
|
@computed('fancy_title')
|
||||||
|
|
Loading…
Reference in a new issue