Properly checked for channel change before closing LHS (#2833)

Этот коммит содержится в:
Harrison Healey
2016-05-02 08:08:53 -04:00
коммит произвёл Christopher Speller
родитель 6abb2275dd
Коммит 157438545c

Просмотреть файл

@@ -162,7 +162,7 @@ export default class Sidebar extends React.Component {
} }
return false; return false;
} }
componentDidUpdate() { componentDidUpdate(prevProps, prevState) {
this.updateTitle(); this.updateTitle();
this.updateUnreadIndicators(); this.updateUnreadIndicators();
if (!Utils.isMobile()) { if (!Utils.isMobile()) {
@@ -170,9 +170,11 @@ export default class Sidebar extends React.Component {
} }
// close the LHS on mobile when you change channels // close the LHS on mobile when you change channels
if (this.state.activeId !== prevState.activeId) {
$('.app__body .inner-wrap').removeClass('move--right'); $('.app__body .inner-wrap').removeClass('move--right');
$('.app__body .sidebar--left').removeClass('move--right'); $('.app__body .sidebar--left').removeClass('move--right');
} }
}
componentWillUnmount() { componentWillUnmount() {
window.removeEventListener('resize', this.handleResize); window.removeEventListener('resize', this.handleResize);