From 2c15094368471481ab1b8596d199d4fc51079521 Mon Sep 17 00:00:00 2001 From: Nick Frazier Date: Mon, 19 Dec 2016 16:46:52 -0500 Subject: 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 --- webapp/components/sidebar.jsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'webapp/components/sidebar.jsx') 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'); } } -- cgit v1.2.3-1-g7c22