diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2016-05-02 08:08:53 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-05-02 08:08:53 -0400 |
commit | 157438545c879c7b13248296f2a8392133245b05 (patch) | |
tree | df635a76d58c66d74f71f7ffcdc34a64d4fc7eeb | |
parent | 6abb2275dd2eb3564b034e3bd65eb0c0397f1d0a (diff) | |
download | chat-157438545c879c7b13248296f2a8392133245b05.tar.gz chat-157438545c879c7b13248296f2a8392133245b05.tar.bz2 chat-157438545c879c7b13248296f2a8392133245b05.zip |
Properly checked for channel change before closing LHS (#2833)
-rw-r--r-- | webapp/components/sidebar.jsx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/webapp/components/sidebar.jsx b/webapp/components/sidebar.jsx index 1f73e743f..4ab8b6b40 100644 --- a/webapp/components/sidebar.jsx +++ b/webapp/components/sidebar.jsx @@ -162,7 +162,7 @@ export default class Sidebar extends React.Component { } return false; } - componentDidUpdate() { + componentDidUpdate(prevProps, prevState) { this.updateTitle(); this.updateUnreadIndicators(); if (!Utils.isMobile()) { @@ -170,8 +170,10 @@ export default class Sidebar extends React.Component { } // close the LHS on mobile when you change channels - $('.app__body .inner-wrap').removeClass('move--right'); - $('.app__body .sidebar--left').removeClass('move--right'); + if (this.state.activeId !== prevState.activeId) { + $('.app__body .inner-wrap').removeClass('move--right'); + $('.app__body .sidebar--left').removeClass('move--right'); + } } componentWillUnmount() { window.removeEventListener('resize', this.handleResize); |