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
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
c8cd3d22ad
Коммит
2c15094368
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user