summaryrefslogtreecommitdiffstats
path: root/webapp/components/sidebar.jsx
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2016-05-02 08:08:53 -0400
committerChristopher Speller <crspeller@gmail.com>2016-05-02 08:08:53 -0400
commit157438545c879c7b13248296f2a8392133245b05 (patch)
treedf635a76d58c66d74f71f7ffcdc34a64d4fc7eeb /webapp/components/sidebar.jsx
parent6abb2275dd2eb3564b034e3bd65eb0c0397f1d0a (diff)
downloadchat-157438545c879c7b13248296f2a8392133245b05.tar.gz
chat-157438545c879c7b13248296f2a8392133245b05.tar.bz2
chat-157438545c879c7b13248296f2a8392133245b05.zip
Properly checked for channel change before closing LHS (#2833)
Diffstat (limited to 'webapp/components/sidebar.jsx')
-rw-r--r--webapp/components/sidebar.jsx8
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);