diff options
author | nickago <ngonella@calpoly.edu> | 2015-07-06 08:14:42 -0700 |
---|---|---|
committer | nickago <ngonella@calpoly.edu> | 2015-07-06 08:14:42 -0700 |
commit | 0b71537ff0e117f6845fd9294fa9df34f483c6bb (patch) | |
tree | a9366bf08fc4c1f9baacafc7099ec31f4960f7aa /web/react/stores | |
parent | b819b492bf3c5d1f2353b086dbf7b70fd6a98869 (diff) | |
download | chat-0b71537ff0e117f6845fd9294fa9df34f483c6bb.tar.gz chat-0b71537ff0e117f6845fd9294fa9df34f483c6bb.tar.bz2 chat-0b71537ff0e117f6845fd9294fa9df34f483c6bb.zip |
Typing notifier resets on channel change
Diffstat (limited to 'web/react/stores')
-rw-r--r-- | web/react/stores/channel_store.jsx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/web/react/stores/channel_store.jsx b/web/react/stores/channel_store.jsx index 3f259bc7d..3713999a6 100644 --- a/web/react/stores/channel_store.jsx +++ b/web/react/stores/channel_store.jsx @@ -12,6 +12,7 @@ var ActionTypes = Constants.ActionTypes; var CHANGE_EVENT = 'change'; var MORE_CHANGE_EVENT = 'change'; var EXTRA_INFO_EVENT = 'extra_info'; +var DIFF_CHANNEL_EVENT = 'change_channel'; var ChannelStore = assign({}, EventEmitter.prototype, { emitChange: function() { @@ -23,6 +24,15 @@ var ChannelStore = assign({}, EventEmitter.prototype, { removeChangeListener: function(callback) { this.removeListener(CHANGE_EVENT, callback); }, + emitDiffChannelChange: function() { + this.emit(DIFF_CHANNEL_EVENT); + }, + addDiffChannelChangeListener: function(callback) { + this.on(DIFF_CHANNEL_EVENT,callback); + }, + removeDiffChannelChangeListener: function(callback) { + this.removeListener(DIFF_CHANNEL_EVENT,callback); + }, emitMoreChange: function() { this.emit(MORE_CHANGE_EVENT); }, @@ -218,6 +228,8 @@ var ChannelStore = assign({}, EventEmitter.prototype, { ChannelStore.dispatchToken = AppDispatcher.register(function(payload) { var action = payload.action; + //console.log(payload); + //console.log(action.type + " " + (action.msg ? action.msg.action : "")) switch(action.type) { @@ -225,6 +237,7 @@ ChannelStore.dispatchToken = AppDispatcher.register(function(payload) { ChannelStore.setCurrentId(action.id); ChannelStore.setLastVisitedName(action.name); ChannelStore.resetCounts(action.id); + ChannelStore.emitDiffChannelChange(); ChannelStore.emitChange(); break; |