From 3f0d6ee6a1fde38f51212a123604c5d27da56e79 Mon Sep 17 00:00:00 2001 From: David Lu Date: Mon, 11 Jul 2016 21:02:11 -0400 Subject: sorted channel switcher by handle (#3547) --- webapp/components/suggestion/switch_channel_provider.jsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3-1-g7c22