From 999d1553e1ce45adf58f6082b160bc1147dc592b Mon Sep 17 00:00:00 2001
From: enahum <nahumhbl@gmail.com>
Date: Mon, 19 Dec 2016 10:05:46 -0300
Subject: PLT-4167 Team Sidebar (#4569)

* PLT-4167 Team Sidebar

* Address feedback from PM

* change route from my_members to members

* bug fixes

* Updating styles for teams sidebar (#4681)

* Added PM changes

* Fix corner cases

* Addressing feedback

* use two different endpoints

* Bug fixes

* Rename model and client functions, using preferences to store last team and channel viewed

* Fix mobile notification count and closing the team sidebar

* unit test, fixed bad merge and retrieve from cached when available

* bug fixes

* use id for last channel in preferences, query optimization

* Updating multi team css (#4830)
---
 webapp/components/create_team/create_team_controller.jsx | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

(limited to 'webapp/components/create_team/create_team_controller.jsx')

diff --git a/webapp/components/create_team/create_team_controller.jsx b/webapp/components/create_team/create_team_controller.jsx
index 77a7f659f..84b890e26 100644
--- a/webapp/components/create_team/create_team_controller.jsx
+++ b/webapp/components/create_team/create_team_controller.jsx
@@ -2,6 +2,8 @@
 // See License.txt for license information.
 
 import ErrorBar from 'components/error_bar.jsx';
+import ChannelStore from 'stores/channel_store.jsx';
+import TeamStore from 'stores/team_store.jsx';
 
 import {FormattedMessage} from 'react-intl';
 import {browserHistory, Link} from 'react-router/es6';
@@ -47,11 +49,21 @@ export default class CreateTeamController extends React.Component {
             );
         }
 
+        let url = '/select_team';
+        const team = TeamStore.getCurrent();
+        const channel = ChannelStore.getCurrent();
+        if (team) {
+            url = `/${team.name}`;
+            if (channel) {
+                url += `/channels/${channel.name}`;
+            }
+        }
+
         return (
             <div>
                 <ErrorBar/>
                 <div className='signup-header'>
-                    <Link to='/select_team'>
+                    <Link to={url}>
                         <span className='fa fa-chevron-left'/>
                         <FormattedMessage
                             id='web.header.back'
-- 
cgit v1.2.3-1-g7c22

