From ab154d50ea67acf7b1afa347ad5f2186369d169d Mon Sep 17 00:00:00 2001
From: nickago <ngonella@calpoly.edu>
Date: Tue, 30 Jun 2015 07:47:46 -0700
Subject: MM-1289 Now sorts users in lexigraphical order in extra members
 popover

---
 web/react/components/channel_header.jsx | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

(limited to 'web/react/components/channel_header.jsx')

diff --git a/web/react/components/channel_header.jsx b/web/react/components/channel_header.jsx
index 428d3ed81..cd1fb225a 100644
--- a/web/react/components/channel_header.jsx
+++ b/web/react/components/channel_header.jsx
@@ -44,8 +44,13 @@ var ExtraMembers = React.createClass({
         var count = this.props.members.length == 0 ? "-" : this.props.members.length;
         count = this.props.members.length > 19 ? "20+" : count;
         var data_content = "";
+        var sortedMembers = this.props.members;
 
-        this.props.members.forEach(function(m) {
+        sortedMembers.sort(function(a,b) {
+            return a.username.localeCompare(b.username);
+        })
+
+        sortedMembers.forEach(function(m) {
             data_content += "<div style='white-space: nowrap'>" + m.username + "</div>";
         });
 
-- 
cgit v1.2.3-1-g7c22

