diff options
author | hmhealey <harrisonmhealey@gmail.com> | 2015-11-12 11:38:52 -0500 |
---|---|---|
committer | hmhealey <harrisonmhealey@gmail.com> | 2015-11-12 11:38:56 -0500 |
commit | 3c40a683a1735bc01a4dcddaf5b96803d3434628 (patch) | |
tree | 1e3fcebf7f3ad8617029421cac4248f312178556 /web/react | |
parent | 13a251a5ee940383e5a026284275b1f31fb476df (diff) | |
download | chat-3c40a683a1735bc01a4dcddaf5b96803d3434628.tar.gz chat-3c40a683a1735bc01a4dcddaf5b96803d3434628.tar.bz2 chat-3c40a683a1735bc01a4dcddaf5b96803d3434628.zip |
Sorted channel list before rendering them in the sidebar
Diffstat (limited to 'web/react')
-rw-r--r-- | web/react/components/sidebar.jsx | 2 |
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); |