diff options
author | Nick Frazier <nrflaw@gmail.com> | 2016-12-19 16:46:52 -0500 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2016-12-19 16:46:52 -0500 |
commit | 2c15094368471481ab1b8596d199d4fc51079521 (patch) | |
tree | 7dac1be9ac4e5d027778927d79ede5de994c2fd6 /webapp | |
parent | c8cd3d22ad8f6c184ed2c5f4b285bf939b593572 (diff) | |
download | chat-2c15094368471481ab1b8596d199d4fc51079521.tar.gz chat-2c15094368471481ab1b8596d199d4fc51079521.tar.bz2 chat-2c15094368471481ab1b8596d199d4fc51079521.zip |
GH-4558 Mobile View: Don't close the Left Hand Sidebar after removing an open Direct Message Channel (#4776)
* added fix
* use class var instead of state var
* removed onUpdate
Diffstat (limited to 'webapp')
-rw-r--r-- | webapp/components/sidebar.jsx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/webapp/components/sidebar.jsx b/webapp/components/sidebar.jsx index 203464600..0651ebeee 100644 --- a/webapp/components/sidebar.jsx +++ b/webapp/components/sidebar.jsx @@ -69,6 +69,7 @@ export default class Sidebar extends React.Component { this.isLeaving = new Map(); this.isSwitchingChannel = false; + this.closedDirectChannel = false; const state = this.getStateFromStores(); state.newChannelModalType = ''; @@ -161,9 +162,13 @@ export default class Sidebar extends React.Component { // close the LHS on mobile when you change channels if (this.state.activeId !== prevState.activeId) { - $('.app__body .inner-wrap').removeClass('move--right'); - $('.app__body .sidebar--left').removeClass('move--right'); - $('.multi-teams .team-sidebar').removeClass('move--right'); + if (this.closedDirectChannel) { + this.closedDirectChannel = false; + } else { + $('.app__body .inner-wrap').removeClass('move--right'); + $('.app__body .sidebar--left').removeClass('move--right'); + $('.multi-teams .team-sidebar').removeClass('move--right'); + } } } @@ -349,6 +354,7 @@ export default class Sidebar extends React.Component { } if (channel.id === this.state.activeId) { + this.closedDirectChannel = true; browserHistory.push('/' + this.state.currentTeam.name + '/channels/town-square'); } } |