FIX: Presence was broken with a null array

This commit is contained in:
Robin Ward 2017-09-08 10:20:13 -04:00
parent 846e573766
commit a9ed0023dc
2 changed files with 2 additions and 2 deletions

View File

@ -5,7 +5,7 @@ export default Ember.Component.extend({
@computed('composer.presenceUsers', 'currentUser.id')
users(presenceUsers, currentUser_id){
return presenceUsers.filter(user => user.id !== currentUser_id);
return (presenceUsers || []).filter(user => user.id !== currentUser_id);
},
@computed('composer.presenceState.action')
@ -17,5 +17,4 @@ export default Ember.Component.extend({
shouldDisplay(length){
return length > 0;
}
});

View File

@ -10,6 +10,7 @@ function initialize(api) {
presenceState: { compose_state: 'closed' },
keepAliveTimer: null,
messageBusChannel: null,
presenceUsers: null,
@observes('model.composeState', 'model.action', 'model.post', 'model.topic')
openStatusChanged(){