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/actions/global_actions.jsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'webapp/actions/global_actions.jsx')

diff --git a/webapp/actions/global_actions.jsx b/webapp/actions/global_actions.jsx
index beca75509..2d1638060 100644
--- a/webapp/actions/global_actions.jsx
+++ b/webapp/actions/global_actions.jsx
@@ -570,7 +570,7 @@ export function redirectUserToDefaultTeam() {
         }
 
         if (myTeams.length > 0) {
-            myTeams = myTeams.sort((a, b) => a.display_name.localeCompare(b.display_name));
+            myTeams = myTeams.sort(Utils.sortTeamsByDisplayName);
             teamId = myTeams[0].id;
         }
     }
-- 
cgit v1.2.3-1-g7c22

