summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-11-12 12:36:41 -0500
committerChristopher Speller <crspeller@gmail.com>2015-11-12 12:36:41 -0500
commitcce0dc19e60b0393ee1e7d735249c847d4d8df7f (patch)
treec24bbbb8cecc925d5148673769ccfafc727aa084
parentc1ab5adb209cefde121aff308b77e470368422cd (diff)
parent3c40a683a1735bc01a4dcddaf5b96803d3434628 (diff)
downloadchat-cce0dc19e60b0393ee1e7d735249c847d4d8df7f.tar.gz
chat-cce0dc19e60b0393ee1e7d735249c847d4d8df7f.tar.bz2
chat-cce0dc19e60b0393ee1e7d735249c847d4d8df7f.zip
Merge pull request #1411 from hmhealey/plt876
PLT-876 Sorted channel list before rendering them in the sidebar
-rw-r--r--web/react/components/sidebar.jsx2
1 files changed, 2 insertions, 0 deletions
diff --git a/web/react/components/sidebar.jsx b/web/react/components/sidebar.jsx
index f5ce5c10e..e3ee9f14b 100644
--- a/web/react/components/sidebar.jsx
+++ b/web/react/components/sidebar.jsx
@@ -106,6 +106,8 @@ export default class Sidebar extends React.Component {
const currentChannelId = ChannelStore.getCurrentId();
const channels = Object.assign([], ChannelStore.getAll());
+ channels.sort((a, b) => a.display_name.localeCompare(b.display_name));
+
const publicChannels = channels.filter((channel) => channel.type === Constants.OPEN_CHANNEL);
const privateChannels = channels.filter((channel) => channel.type === Constants.PRIVATE_CHANNEL);
const directChannels = channels.filter((channel) => channel.type === Constants.DM_CHANNEL);