mirror of
https://github.com/element-hq/element-web
synced 2024-11-24 02:05:45 +03:00
allow LoggedInView to override collapseLhs
by updating prop through the dispatcher instead of having it's own state that is OR'ed in. before the state couldn't override the prop and you couldn't expand the left panel anymore when MatrixChat decided your viewport was too narrow
This commit is contained in:
parent
3a23423a43
commit
3251a055c2
1 changed files with 4 additions and 2 deletions
|
@ -164,9 +164,11 @@ const LoggedInView = React.createClass({
|
|||
const collapseConfig = {
|
||||
toggleSize: 260 - 50,
|
||||
onCollapsed: (collapsed) => {
|
||||
this.setState({collapseLhs: collapsed});
|
||||
if (collapsed) {
|
||||
dis.dispatch({action: "hide_left_panel"}, true);
|
||||
window.localStorage.setItem("mx_lhs_size", '0');
|
||||
} else {
|
||||
dis.dispatch({action: "show_left_panel"}, true);
|
||||
}
|
||||
},
|
||||
onResized: (size) => {
|
||||
|
@ -540,7 +542,7 @@ const LoggedInView = React.createClass({
|
|||
<div ref={this._setResizeContainerRef} className={bodyClasses}>
|
||||
<LeftPanel
|
||||
toolbarShown={!!topBar}
|
||||
collapsed={this.props.collapseLhs || this.state.collapseLhs || false}
|
||||
collapsed={this.props.collapseLhs || false}
|
||||
disabled={this.props.leftDisabled}
|
||||
/>
|
||||
<ResizeHandle />
|
||||
|
|
Loading…
Reference in a new issue