diff options
author | George Goldberg <george@gberg.me> | 2017-02-23 02:33:13 +0000 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2017-02-22 21:33:13 -0500 |
commit | 7883a515e72690e08e10d38fafc741da1e7a0deb (patch) | |
tree | b401259fd2a18390d8aac8fb76135e70723da4c3 /webapp/stores/channel_store.jsx | |
parent | 9f65284ba1c67c20de1ccd7a5af80aa64c3575f7 (diff) | |
download | chat-7883a515e72690e08e10d38fafc741da1e7a0deb.tar.gz chat-7883a515e72690e08e10d38fafc741da1e7a0deb.tar.bz2 chat-7883a515e72690e08e10d38fafc741da1e7a0deb.zip |
Fix Utils importing in ChannelStore. (#5503)
This fixes a whole load of bugs around Channel Members Modals, and
elsewhere where the Channel Members are used. Most of those bugs have
been alreay closed as "Cannot Reproduce" becaues the issue was a really
nasty race condition in the javascript!
Diffstat (limited to 'webapp/stores/channel_store.jsx')
-rw-r--r-- | webapp/stores/channel_store.jsx | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/webapp/stores/channel_store.jsx b/webapp/stores/channel_store.jsx index 0228345bc..c46e17016 100644 --- a/webapp/stores/channel_store.jsx +++ b/webapp/stores/channel_store.jsx @@ -7,6 +7,7 @@ import EventEmitter from 'events'; import TeamStore from 'stores/team_store.jsx'; import UserStore from 'stores/user_store.jsx'; +var ChannelUtils; var Utils; import {ActionTypes, Constants} from 'utils/constants.jsx'; import {isSystemMessage} from 'utils/post_utils.jsx'; @@ -204,11 +205,11 @@ class ChannelStoreClass extends EventEmitter { channels.push(channel); } - if (!Utils) { - Utils = require('utils/channel_utils.jsx'); //eslint-disable-line global-require + if (!ChannelUtils) { + ChannelUtils = require('utils/channel_utils.jsx'); //eslint-disable-line global-require } - channels = channels.sort(Utils.sortChannelsByDisplayName); + channels = channels.sort(ChannelUtils.sortChannelsByDisplayName); this.storeChannels(channels); } @@ -286,11 +287,11 @@ class ChannelStoreClass extends EventEmitter { getMoreChannelsList(teamId = TeamStore.getCurrentId()) { const teamChannels = this.moreChannels[teamId] || {}; - if (!Utils) { - Utils = require('utils/channel_utils.jsx'); //eslint-disable-line global-require + if (!ChannelUtils) { + ChannelUtils = require('utils/channel_utils.jsx'); //eslint-disable-line global-require } - return Object.keys(teamChannels).map((cid) => teamChannels[cid]).sort(Utils.sortChannelsByDisplayName); + return Object.keys(teamChannels).map((cid) => teamChannels[cid]).sort(ChannelUtils.sortChannelsByDisplayName); } storeStats(stats) { |