mirror of
https://github.com/element-hq/element-web
synced 2024-11-28 12:28:50 +03:00
Copy state when initialisng, reset state when logging out
This commit is contained in:
parent
f38690f265
commit
e1ea8f0a78
1 changed files with 7 additions and 1 deletions
|
@ -31,7 +31,7 @@ class TagOrderStore extends Store {
|
||||||
super(dis);
|
super(dis);
|
||||||
|
|
||||||
// Initialise state
|
// Initialise state
|
||||||
this._state = INITIAL_STATE;
|
this._state = Object.assign({}, INITIAL_STATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
_setState(newState) {
|
_setState(newState) {
|
||||||
|
@ -93,6 +93,12 @@ class TagOrderStore extends Store {
|
||||||
this._setState({orderedTags});
|
this._setState({orderedTags});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 'on_logged_out': {
|
||||||
|
// Reset state without pushing an update to the view, which generally assumes that
|
||||||
|
// the matrix client isn't `null` and so causing a re-render will cause NPEs.
|
||||||
|
this._state = Object.assign({}, INITIAL_STATE);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue