FIX: lastPoster not defined correctly in model
This commit is contained in:
parent
33fb870e48
commit
0d15dbd886
|
@ -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…
Reference in New Issue