diff options
Diffstat (limited to 'web/react/stores')
-rw-r--r-- | web/react/stores/channel_store.jsx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/web/react/stores/channel_store.jsx b/web/react/stores/channel_store.jsx index bd655b767..b9ba37c27 100644 --- a/web/react/stores/channel_store.jsx +++ b/web/react/stores/channel_store.jsx @@ -10,6 +10,7 @@ var ActionTypes = Constants.ActionTypes; var BrowserStore = require('../stores/browser_store.jsx'); var CHANGE_EVENT = 'change'; +var LEAVE_EVENT = 'leave'; var MORE_CHANGE_EVENT = 'change'; var EXTRA_INFO_EVENT = 'extra_info'; @@ -48,6 +49,15 @@ class ChannelStoreClass extends EventEmitter { removeExtraInfoChangeListener(callback) { this.removeListener(EXTRA_INFO_EVENT, callback); } + emitLeave(id) { + this.emit(LEAVE_EVENT, id); + } + addLeaveListener(callback) { + this.on(LEAVE_EVENT, callback); + } + removeLeaveListener(callback) { + this.removeListener(LEAVE_EVENT, callback); + } findFirstBy(field, value) { var channels = this.pGetChannels(); for (var i = 0; i < channels.length; i++) { @@ -272,6 +282,10 @@ ChannelStore.dispatchToken = AppDispatcher.register(function handleAction(payloa ChannelStore.emitExtraInfoChange(); break; + case ActionTypes.LEAVE_CHANNEL: + ChannelStore.emitLeave(action.id); + break; + default: break; } |