From 4cf9e0c1ae46d22baef4463376b33c7e577f62cc Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 24 Apr 2017 22:00:59 +0100 Subject: [PATCH] Create a way to restore last state of the rhs panel. Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/structures/MatrixChat.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 9b8aa3426a..6df8d99c3a 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -303,6 +303,7 @@ module.exports = React.createClass({ componentDidUpdate: function() { if (this.focusComposer) { + console.log('is this the shitty duplicate?'); dis.dispatch({action: 'focus_composer'}); this.focusComposer = false; } @@ -547,15 +548,23 @@ module.exports = React.createClass({ }); break; case 'hide_right_panel': + this.was_rhs_collapsed = this.state.collapse_rhs; this.setState({ collapse_rhs: true, }); break; case 'show_right_panel': + this.was_rhs_collapsed = this.state.collapse_rhs; this.setState({ collapse_rhs: false, }); break; + // sets the panel to its state before last show/hide event + case 'restore_right_panel': + this.setState({ + collapse_rhs: this.was_rhs_collapsed, + }); + break; case 'ui_opacity': this.setState({ sideOpacity: payload.sideOpacity,