From ea80836c6e0acc4fe871024aab04ceba045bdcad Mon Sep 17 00:00:00 2001
From: hmhealey <harrisonmhealey@gmail.com>
Date: Thu, 3 Dec 2015 12:57:34 -0500
Subject: Removed some internal state from ChannelMembersModal and
 ChannelInviteModal

---
 web/react/stores/channel_store.jsx | 18 +++++-------------
 1 file changed, 5 insertions(+), 13 deletions(-)

(limited to 'web/react/stores/channel_store.jsx')

diff --git a/web/react/stores/channel_store.jsx b/web/react/stores/channel_store.jsx
index 5dec86951..0bfde77b4 100644
--- a/web/react/stores/channel_store.jsx
+++ b/web/react/stores/channel_store.jsx
@@ -167,18 +167,7 @@ class ChannelStoreClass extends EventEmitter {
         this.emitChange();
     }
     getCurrentExtraInfo() {
-        var currentId = this.getCurrentId();
-        var extra = null;
-
-        if (currentId) {
-            extra = this.pGetExtraInfos()[currentId];
-        }
-
-        if (extra == null) {
-            extra = {members: []};
-        }
-
-        return extra;
+        return this.getExtraInfo(this.getCurrentId());
     }
     getExtraInfo(channelId) {
         var extra = null;
@@ -187,7 +176,10 @@ class ChannelStoreClass extends EventEmitter {
             extra = this.pGetExtraInfos()[channelId];
         }
 
-        if (extra == null) {
+        if (extra) {
+            // create a defensive copy
+            extra = JSON.parse(JSON.stringify(extra));
+        } else {
             extra = {members: []};
         }
 
-- 
cgit v1.2.3-1-g7c22

