diff options
author | David Lu <david.lu@hotmail.com> | 2016-07-11 21:02:11 -0400 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2016-07-11 21:02:11 -0400 |
commit | 3f0d6ee6a1fde38f51212a123604c5d27da56e79 (patch) | |
tree | 92669dd908ffd472efe92b255a7c5cd7c8d0bf2a /webapp | |
parent | 4522fc6388e09fc7790769370a24ec738f65e413 (diff) | |
download | chat-3f0d6ee6a1fde38f51212a123604c5d27da56e79.tar.gz chat-3f0d6ee6a1fde38f51212a123604c5d27da56e79.tar.bz2 chat-3f0d6ee6a1fde38f51212a123604c5d27da56e79.zip |
sorted channel switcher by handle (#3547)
Diffstat (limited to 'webapp')
-rw-r--r-- | webapp/components/suggestion/switch_channel_provider.jsx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/webapp/components/suggestion/switch_channel_provider.jsx b/webapp/components/suggestion/switch_channel_provider.jsx index c12918c51..e092d9b5c 100644 --- a/webapp/components/suggestion/switch_channel_provider.jsx +++ b/webapp/components/suggestion/switch_channel_provider.jsx @@ -57,7 +57,13 @@ export default class SwitchChannelProvider { } } - channels.sort((a, b) => a.display_name.localeCompare(b.display_name)); + channels.sort((a, b) => { + if (a.display_name === b.display_name) { + return a.name.localeCompare(b.name); + } + return a.display_name.localeCompare(b.display_name); + }); + const channelNames = channels.map((channel) => channel.name); SuggestionStore.addSuggestions(suggestionId, channelNames, channels, SwitchChannelSuggestion, channelPrefix); |