mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-04-01 09:39:51 -04:00
FIX: lastPoster not defined correctly in model
This commit is contained in:
parent
33fb870e48
commit
0d15dbd886
1 changed files with 15 additions and 1 deletions
|
@ -8,7 +8,21 @@ const Topic = RestModel.extend({
|
|||
message: null,
|
||||
errorLoading: false,
|
||||
|
||||
lastPoster: Ember.computed.alias("posters.lastObject.user"),
|
||||
@computed('posters.firstObject')
|
||||
creator(poster){
|
||||
return poster && poster.user;
|
||||
},
|
||||
|
||||
@computed('posters.lastObject')
|
||||
lastPoster(poster) {
|
||||
if (poster){
|
||||
if (this.last_poster_username === poster.user.username){
|
||||
return poster.user;
|
||||
} else {
|
||||
return this.get('creator');
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@computed('fancy_title')
|
||||
fancyTitle(title) {
|
||||
|
|
Loading…
Add table
Reference in a new issue