From 9ba968ce3354b1a8ab307ecc4cc785bdee16f914 Mon Sep 17 00:00:00 2001
From: Saturnino Abril <saturnino.abril@gmail.com>
Date: Wed, 1 Feb 2017 08:57:16 +0900
Subject: 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
---
 webapp/components/admin_console/admin_navbar_dropdown.jsx | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

(limited to 'webapp/components/admin_console/admin_navbar_dropdown.jsx')

diff --git a/webapp/components/admin_console/admin_navbar_dropdown.jsx b/webapp/components/admin_console/admin_navbar_dropdown.jsx
index d4e144c4f..a1ec2885b 100644
--- a/webapp/components/admin_console/admin_navbar_dropdown.jsx
+++ b/webapp/components/admin_console/admin_navbar_dropdown.jsx
@@ -6,6 +6,7 @@ import ReactDOM from 'react-dom';
 
 import TeamStore from 'stores/team_store.jsx';
 import Constants from 'utils/constants.jsx';
+import {sortTeamsByDisplayName} from 'utils/utils.jsx';
 import * as GlobalActions from 'actions/global_actions.jsx';
 
 import {FormattedMessage} from 'react-intl';
@@ -64,9 +65,7 @@ export default class AdminNavbarDropdown extends React.Component {
             }
 
             // Sort teams alphabetically with display_name
-            teamsArray.sort((teamA, teamB) =>
-                teamA.display_name.localeCompare(teamB.display_name)
-            );
+            teamsArray = teamsArray.sort(sortTeamsByDisplayName);
 
             for (const team of teamsArray) {
                 teams.push(
-- 
cgit v1.2.3-1-g7c22

