From a9ed0023dcaa8f8ad228298f09e752ae034a6f00 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Fri, 8 Sep 2017 10:20:13 -0400 Subject: [PATCH] FIX: Presence was broken with a null array --- .../discourse/components/composer-presence-display.js.es6 | 3 +-- .../discourse/initializers/composer-controller-presence.js.es6 | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/discourse-presence/assets/javascripts/discourse/components/composer-presence-display.js.es6 b/plugins/discourse-presence/assets/javascripts/discourse/components/composer-presence-display.js.es6 index 4c2437e99b5..dd50d3609d5 100644 --- a/plugins/discourse-presence/assets/javascripts/discourse/components/composer-presence-display.js.es6 +++ b/plugins/discourse-presence/assets/javascripts/discourse/components/composer-presence-display.js.es6 @@ -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; } - }); diff --git a/plugins/discourse-presence/assets/javascripts/discourse/initializers/composer-controller-presence.js.es6 b/plugins/discourse-presence/assets/javascripts/discourse/initializers/composer-controller-presence.js.es6 index 68f7d6f9841..3a98851d70f 100644 --- a/plugins/discourse-presence/assets/javascripts/discourse/initializers/composer-controller-presence.js.es6 +++ b/plugins/discourse-presence/assets/javascripts/discourse/initializers/composer-controller-presence.js.es6 @@ -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(){