From 0bbc599b687473b9afacbe2e1c769cf1a41e9681 Mon Sep 17 00:00:00 2001
From: George Goldberg <george@gberg.me>
Date: Thu, 15 Dec 2016 02:10:07 +0000
Subject: Fix team chooser sort when there are no teams. (#4796)

---
 webapp/components/select_team/select_team.jsx | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'webapp/components/select_team/select_team.jsx')

diff --git a/webapp/components/select_team/select_team.jsx b/webapp/components/select_team/select_team.jsx
index 133e9d581..eef3b7931 100644
--- a/webapp/components/select_team/select_team.jsx
+++ b/webapp/components/select_team/select_team.jsx
@@ -84,6 +84,8 @@ export default class SelectTeam extends React.Component {
             );
         }
 
+        teamContents = teamContents.sort(this.teamContentsCompare);
+
         var openTeamContents = [];
 
         for (const id in this.state.teamListings) {
@@ -137,7 +139,7 @@ export default class SelectTeam extends React.Component {
                         />
                     </h4>
                     <div className='signup-team-all'>
-                        {teamContents.sort(this.teamContentsCompare)}
+                        {teamContents}
                     </div>
                 </div>
             );
-- 
cgit v1.2.3-1-g7c22

