summaryrefslogtreecommitdiffstats
path: root/webapp/components/team_sidebar
diff options
context:
space:
mode:
authorSaturnino Abril <saturnino.abril@gmail.com>2017-02-01 08:57:16 +0900
committerenahum <nahumhbl@gmail.com>2017-01-31 20:57:16 -0300
commit9ba968ce3354b1a8ab307ecc4cc785bdee16f914 (patch)
tree1180a7913c326ed66191555d5a21d0643e932b8a /webapp/components/team_sidebar
parent9369cab56c82629d505d44d572f273df1d396972 (diff)
downloadchat-9ba968ce3354b1a8ab307ecc4cc785bdee16f914.tar.gz
chat-9ba968ce3354b1a8ab307ecc4cc785bdee16f914.tar.bz2
chat-9ba968ce3354b1a8ab307ecc4cc785bdee16f914.zip
Use consistent Display Name sorting code throughout the webapp #5159 (#5213)
* Use consistent Display Name sorting code throughout the webapp #5159 * fixed broken sorting of teams and channels
Diffstat (limited to 'webapp/components/team_sidebar')
-rw-r--r--webapp/components/team_sidebar/team_sidebar_controller.jsx30
1 files changed, 15 insertions, 15 deletions
diff --git a/webapp/components/team_sidebar/team_sidebar_controller.jsx b/webapp/components/team_sidebar/team_sidebar_controller.jsx
index ac3a9f894..49635455f 100644
--- a/webapp/components/team_sidebar/team_sidebar_controller.jsx
+++ b/webapp/components/team_sidebar/team_sidebar_controller.jsx
@@ -118,21 +118,21 @@ export default class TeamSidebar extends React.Component {
}
const teams = myTeams.
- sort((a, b) => a.display_name.localeCompare(b.display_name)).
- map((team) => {
- return (
- <TeamButton
- key={'switch_team_' + team.name}
- url={`/${team.name}`}
- tip={team.display_name}
- active={team.id === this.state.currentTeamId}
- isMobile={this.state.isMobile}
- displayName={team.display_name}
- unread={team.unread}
- mentions={team.mentions}
- />
- );
- });
+ sort(Utils.sortTeamsByDisplayName).
+ map((team) => {
+ return (
+ <TeamButton
+ key={'switch_team_' + team.name}
+ url={`/${team.name}`}
+ tip={team.display_name}
+ active={team.id === this.state.currentTeamId}
+ isMobile={this.state.isMobile}
+ displayName={team.display_name}
+ unread={team.unread}
+ mentions={team.mentions}
+ />
+ );
+ });
if (moreTeams) {
teams.push(