summaryrefslogtreecommitdiffstats
path: root/webapp/stores/channel_store.jsx
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2016-11-01 12:58:04 -0400
committerCorey Hulen <corey@hulen.com>2016-11-01 09:58:04 -0700
commitb4002ba55f9a96ca2f21b3ad2afced37b47ac69e (patch)
treebb748872d73ba9a9dd333fd53349aa4aa5a33822 /webapp/stores/channel_store.jsx
parentef53aa1e7f2233a5c094b6cfdd0b647566b1b75c (diff)
downloadchat-b4002ba55f9a96ca2f21b3ad2afced37b47ac69e.tar.gz
chat-b4002ba55f9a96ca2f21b3ad2afced37b47ac69e.tar.bz2
chat-b4002ba55f9a96ca2f21b3ad2afced37b47ac69e.zip
Plt-4483 Removed unnecessary events from ChannelStore (#4407)
* PLT-4483 Removed MoreChange listener from ChannelStore * PLT-4483 Removed LeaveChannel listener from ChannelStore
Diffstat (limited to 'webapp/stores/channel_store.jsx')
-rw-r--r--webapp/stores/channel_store.jsx45
1 files changed, 3 insertions, 42 deletions
diff --git a/webapp/stores/channel_store.jsx b/webapp/stores/channel_store.jsx
index 3212c1155..13a5c4574 100644
--- a/webapp/stores/channel_store.jsx
+++ b/webapp/stores/channel_store.jsx
@@ -5,13 +5,10 @@ import AppDispatcher from '../dispatcher/app_dispatcher.jsx';
import EventEmitter from 'events';
var Utils;
-import Constants from 'utils/constants.jsx';
-const ActionTypes = Constants.ActionTypes;
+import {ActionTypes, Constants} from 'utils/constants.jsx';
const NotificationPrefs = Constants.NotificationPrefs;
const CHANGE_EVENT = 'change';
-const LEAVE_EVENT = 'leave';
-const MORE_CHANGE_EVENT = 'change';
const STATS_EVENT = 'stats';
const LAST_VIEVED_EVENT = 'last_viewed';
@@ -50,18 +47,6 @@ class ChannelStoreClass extends EventEmitter {
this.removeListener(CHANGE_EVENT, callback);
}
- emitMoreChange() {
- this.emit(MORE_CHANGE_EVENT);
- }
-
- addMoreChangeListener(callback) {
- this.on(MORE_CHANGE_EVENT, callback);
- }
-
- removeMoreChangeListener(callback) {
- this.removeListener(MORE_CHANGE_EVENT, callback);
- }
-
emitStatsChange() {
this.emit(STATS_EVENT);
}
@@ -73,17 +58,6 @@ class ChannelStoreClass extends EventEmitter {
removeStatsChangeListener(callback) {
this.removeListener(STATS_EVENT, callback);
}
- emitLeave(id) {
- this.emit(LEAVE_EVENT, id);
- }
-
- addLeaveListener(callback) {
- this.on(LEAVE_EVENT, callback);
- }
-
- removeLeaveListener(callback) {
- this.removeListener(LEAVE_EVENT, callback);
- }
emitLastViewed(lastViewed, ownNewMessage) {
this.emit(LAST_VIEVED_EVENT, lastViewed, ownNewMessage);
@@ -321,14 +295,6 @@ class ChannelStoreClass extends EventEmitter {
return this.unreadCounts;
}
- leaveChannel(id) {
- Reflect.deleteProperty(this.myChannelMembers, id);
- const element = this.channels.indexOf(id);
- if (element > -1) {
- this.channels.splice(element, 1);
- }
- }
-
getChannelNamesMap() {
var channelNamesMap = {};
@@ -404,7 +370,7 @@ ChannelStore.dispatchToken = AppDispatcher.register((payload) => {
break;
case ActionTypes.RECEIVED_MORE_CHANNELS:
ChannelStore.storeMoreChannels(action.channels);
- ChannelStore.emitMoreChange();
+ ChannelStore.emitChange();
break;
case ActionTypes.RECEIVED_CHANNEL_STATS:
@@ -414,14 +380,9 @@ ChannelStore.dispatchToken = AppDispatcher.register((payload) => {
ChannelStore.emitStatsChange();
break;
- case ActionTypes.LEAVE_CHANNEL:
- ChannelStore.leaveChannel(action.id);
- ChannelStore.emitLeave(action.id);
- break;
-
default:
break;
}
});
-export default ChannelStore;
+export default ChannelStore; \ No newline at end of file