Disable the right panel when the app asks us to

Currently this is only used in the GroupView and for forwarding messages.
pull/21833/head
Travis Ralston 2019-12-06 14:18:18 -07:00
parent a24bbdffd0
commit 814c408e23
3 changed files with 10 additions and 14 deletions

View File

@ -177,7 +177,7 @@ export default createReactClass({
collapseLhs: false,
leftDisabled: false,
middleDisabled: false,
rightDisabled: false,
// the right panel's disabled state is tracked in its store.
version: null,
newVersion: null,
@ -660,7 +660,7 @@ export default createReactClass({
this.setState({
leftDisabled: payload.leftDisabled || payload.sideDisabled || false,
middleDisabled: payload.middleDisabled || false,
rightDisabled: payload.rightDisabled || payload.sideDisabled || false,
// We don't track the right panel being disabled here - it's tracked in the store.
});
break;
}

View File

@ -108,20 +108,9 @@ module.exports = createReactClass({
),
});
});
// dis.dispatch({
// action: 'panel_disable',
// sideDisabled: true,
// middleDisabled: true,
// });
},
componentWillUnmount: function() {
// dis.dispatch({
// action: 'panel_disable',
// sideDisabled: false,
// middleDisabled: false,
// });
if (this.filterTimeout) {
clearTimeout(this.filterTimeout);
}

View File

@ -39,6 +39,8 @@ const GROUP_PHASES = Object.keys(RIGHT_PANEL_PHASES).filter(k => k.startsWith("G
export default class RightPanelStore extends Store {
static _instance;
_inhibitUpdates = false;
constructor() {
super(dis);
@ -107,7 +109,12 @@ export default class RightPanelStore extends Store {
}
__onDispatch(payload) {
if (payload.action !== 'set_right_panel_phase') return;
if (payload.action === 'panel_disable') {
this._inhibitUpdates = payload.rightDisabled || payload.sideDisabled || false;
return;
}
if (payload.action !== 'set_right_panel_phase' || this._inhibitUpdates) return;
const targetPhase = payload.phase;
if (!RIGHT_PANEL_PHASES[targetPhase]) {