From f9b57b65ea8841276cc2803399341566ea875062 Mon Sep 17 00:00:00 2001
From: George Goldberg <george@gberg.me>
Date: Wed, 18 Jan 2017 20:46:21 +0000
Subject: PLT-5135: Fix left channel in more channels list. (#5114)

The problem was it was not being sorted, so appeared at the bottom of
the list.
---
 webapp/stores/channel_store.jsx | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

(limited to 'webapp/stores/channel_store.jsx')

diff --git a/webapp/stores/channel_store.jsx b/webapp/stores/channel_store.jsx
index c1922d3a6..30f395cc3 100644
--- a/webapp/stores/channel_store.jsx
+++ b/webapp/stores/channel_store.jsx
@@ -284,7 +284,12 @@ class ChannelStoreClass extends EventEmitter {
 
     getMoreChannelsList(teamId = TeamStore.getCurrentId()) {
         const teamChannels = this.moreChannels[teamId] || {};
-        return Object.keys(teamChannels).map((cid) => teamChannels[cid]);
+
+        if (!Utils) {
+            Utils = require('utils/utils.jsx'); //eslint-disable-line global-require
+        }
+
+        return Object.keys(teamChannels).map((cid) => teamChannels[cid]).sort(Utils.sortByDisplayName);
     }
 
     storeStats(stats) {
-- 
cgit v1.2.3-1-g7c22

