diff options
author | JoramWilander <jwawilander@gmail.com> | 2015-08-11 11:18:15 -0400 |
---|---|---|
committer | JoramWilander <jwawilander@gmail.com> | 2015-08-11 12:14:58 -0400 |
commit | 1692fca1c3eb2569620813caa59b6a4b82f1872a (patch) | |
tree | 521a8a4c6a0f7b6f72b333b8f969e4968a2cd66b /web/react/components/sidebar.jsx | |
parent | 3f38c217962829e94927c0e1e12b894ffaae72bb (diff) | |
download | chat-1692fca1c3eb2569620813caa59b6a4b82f1872a.tar.gz chat-1692fca1c3eb2569620813caa59b6a4b82f1872a.tar.bz2 chat-1692fca1c3eb2569620813caa59b6a4b82f1872a.zip |
update rename channel modal to not refresh page on channel name change
Diffstat (limited to 'web/react/components/sidebar.jsx')
-rw-r--r-- | web/react/components/sidebar.jsx | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/web/react/components/sidebar.jsx b/web/react/components/sidebar.jsx index f6ac36f50..f4992d4e3 100644 --- a/web/react/components/sidebar.jsx +++ b/web/react/components/sidebar.jsx @@ -102,7 +102,20 @@ function getStateFromStores() { } readDirectChannels = readDirectChannels.slice(index); - showDirectChannels.sort(function(a, b) { + showDirectChannels.sort(function directSort(a, b) { + if (a.display_name < b.display_name) { + return -1; + } + if (a.display_name > b.display_name) { + return 1; + } + return 0; + }); + } + + var channels = ChannelStore.getAll(); + if (channels) { + channels.sort(function chanSort(a, b) { if (a.display_name < b.display_name) { return -1; } @@ -114,8 +127,8 @@ function getStateFromStores() { } return { - active_id: currentId, - channels: ChannelStore.getAll(), + activeId: currentId, + channels: channels, members: members, showDirectChannels: showDirectChannels, hideDirectChannels: readDirectChannels |