From b79b2b2a53935cd883312c1158918291a926bacd Mon Sep 17 00:00:00 2001
From: enahum <nahumhbl@gmail.com>
Date: Thu, 22 Dec 2016 15:20:36 -0300
Subject: Fix team switch (#4851)

* Fix team switch

* Fix channel switching by using BrowserStore

* Fixes plt-5076 and plt-5068

* Updating styles for Teams sidebar (#4875)
---
 webapp/actions/websocket_actions.jsx | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

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

diff --git a/webapp/actions/websocket_actions.jsx b/webapp/actions/websocket_actions.jsx
index 0b2c2102e..63f2c535a 100644
--- a/webapp/actions/websocket_actions.jsx
+++ b/webapp/actions/websocket_actions.jsx
@@ -6,7 +6,6 @@ import $ from 'jquery';
 import UserStore from 'stores/user_store.jsx';
 import TeamStore from 'stores/team_store.jsx';
 import PostStore from 'stores/post_store.jsx';
-import PreferenceStore from 'stores/preference_store.jsx';
 import ChannelStore from 'stores/channel_store.jsx';
 import BrowserStore from 'stores/browser_store.jsx';
 import ErrorStore from 'stores/error_store.jsx';
@@ -224,11 +223,7 @@ function handleLeaveTeamEvent(msg) {
         if (TeamStore.getCurrentId() === msg.data.team_id) {
             TeamStore.setCurrentId('');
             Client.setTeamId('');
-            PreferenceStore.deletePreference({
-                category: 'last',
-                name: 'team',
-                value: msg.data.team_id
-            });
+            BrowserStore.removeGlobalItem(msg.data.team_id);
             GlobalActions.redirectUserToDefaultTeam();
         }
     } else {
-- 
cgit v1.2.3-1-g7c22

