diff options
author | David Lu <david.lu97@outlook.com> | 2016-10-04 08:48:42 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-10-04 08:48:42 -0400 |
commit | 2dd666cb8a16de3a7515e7dae5fe78c9b28b627f (patch) | |
tree | 2b0fbd86f45f5945b596aabc1ea15f2b11b2755d /webapp/components | |
parent | 8f91c777559748fa6e857d9fc1f4ae079a532813 (diff) | |
download | chat-2dd666cb8a16de3a7515e7dae5fe78c9b28b627f.tar.gz chat-2dd666cb8a16de3a7515e7dae5fe78c9b28b627f.tar.bz2 chat-2dd666cb8a16de3a7515e7dae5fe78c9b28b627f.zip |
PLT-4234 Sorted channels in LHS numerically, alphabetically, and based on locale (#4110)
* Sorted channels in LHS numerically, alphabetically, and based on locale
* Choose case based on locale
Diffstat (limited to 'webapp/components')
-rw-r--r-- | webapp/components/sidebar.jsx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/webapp/components/sidebar.jsx b/webapp/components/sidebar.jsx index 712d75548..dc52ebb91 100644 --- a/webapp/components/sidebar.jsx +++ b/webapp/components/sidebar.jsx @@ -14,6 +14,7 @@ import ChannelStore from 'stores/channel_store.jsx'; import UserStore from 'stores/user_store.jsx'; import TeamStore from 'stores/team_store.jsx'; import PreferenceStore from 'stores/preference_store.jsx'; +import LocalizationStore from 'stores/localization_store.jsx'; import * as AsyncClient from 'utils/async_client.jsx'; import * as Utils from 'utils/utils.jsx'; @@ -382,11 +383,13 @@ export default class Sidebar extends React.Component { } sortChannelsByDisplayName(a, b) { + const locale = LocalizationStore.getLocale(); + if (a.display_name === b.display_name) { - return a.name.localeCompare(b.name); + return a.name.localeCompare(b.name, locale, {numeric: true}); } - return a.display_name.localeCompare(b.display_name); + return a.display_name.localeCompare(b.display_name, locale, {numeric: true}); } showMoreChannelsModal() { |