summaryrefslogtreecommitdiffstats
path: root/web/react/stores/channel_store.jsx
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2015-11-04 07:51:49 -0500
committerJoram Wilander <jwawilander@gmail.com>2015-11-04 07:51:49 -0500
commitd9c7fce07744f38715e96f34bf7eaf75d1bcfb00 (patch)
tree9a5edea63395549b8aedd9a9ba5985ef0fb695df /web/react/stores/channel_store.jsx
parent0cc985f6f4c439eb9a951d007628849d15a16087 (diff)
parent9cc000f6e23d75e826c4468dd5c3977397e58e57 (diff)
downloadchat-d9c7fce07744f38715e96f34bf7eaf75d1bcfb00.tar.gz
chat-d9c7fce07744f38715e96f34bf7eaf75d1bcfb00.tar.bz2
chat-d9c7fce07744f38715e96f34bf7eaf75d1bcfb00.zip
Merge pull request #1279 from rgarmsen2295/plt-743
PLT-741/743 Adds additional checks when sorting channels/teams by display name
Diffstat (limited to 'web/react/stores/channel_store.jsx')
-rw-r--r--web/react/stores/channel_store.jsx14
1 files changed, 5 insertions, 9 deletions
diff --git a/web/react/stores/channel_store.jsx b/web/react/stores/channel_store.jsx
index d1f548d50..cc0d0d14b 100644
--- a/web/react/stores/channel_store.jsx
+++ b/web/react/stores/channel_store.jsx
@@ -4,6 +4,7 @@
var AppDispatcher = require('../dispatcher/app_dispatcher.jsx');
var EventEmitter = require('events').EventEmitter;
+var Utils;
var Constants = require('../utils/constants.jsx');
var ActionTypes = Constants.ActionTypes;
@@ -183,16 +184,11 @@ class ChannelStoreClass extends EventEmitter {
channels.push(channel);
}
- channels.sort(function chanSort(a, b) {
- if (a.display_name.toLowerCase() < b.display_name.toLowerCase()) {
- return -1;
- }
- if (a.display_name.toLowerCase() > b.display_name.toLowerCase()) {
- return 1;
- }
- return 0;
- });
+ if (!Utils) {
+ Utils = require('../utils/utils.jsx'); //eslint-disable-line global-require
+ }
+ channels.sort(Utils.sortByDisplayName);
this.pStoreChannels(channels);
}
pStoreChannels(channels) {