diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 5b602fd058..b4e6ee52f2 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -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; } diff --git a/src/components/structures/RoomDirectory.js b/src/components/structures/RoomDirectory.js index efca8d12a8..715bbc5f42 100644 --- a/src/components/structures/RoomDirectory.js +++ b/src/components/structures/RoomDirectory.js @@ -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); } diff --git a/src/stores/RightPanelStore.js b/src/stores/RightPanelStore.js index 2ad18fe521..39a65e2810 100644 --- a/src/stores/RightPanelStore.js +++ b/src/stores/RightPanelStore.js @@ -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]) {