diff options
Diffstat (limited to 'webapp/components/suggestion/switch_channel_provider.jsx')
-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); |