mirror of
https://github.com/vector-im/element-web.git
synced 2026-05-05 12:16:53 +02:00
Merge pull request #1129 from matrix-org/luke/fix-logout
Don't allow UserSettings to render if !MatrixClientPeg.get()
This commit is contained in:
commit
d441ba1fd0
@ -276,6 +276,16 @@ module.exports = React.createClass({
|
||||
}
|
||||
},
|
||||
|
||||
// `UserSettings` assumes that the client peg will not be null, so give it some
|
||||
// sort of assurance here by only allowing a re-render if the client is truthy.
|
||||
//
|
||||
// This is required because `UserSettings` maintains its own state and if this state
|
||||
// updates (e.g. during _setStateFromSessionStore) after the client peg has been made
|
||||
// null (during logout), then it will attempt to re-render and throw errors.
|
||||
shouldComponentUpdate: function() {
|
||||
return Boolean(MatrixClientPeg.get());
|
||||
},
|
||||
|
||||
_setStateFromSessionStore: function() {
|
||||
this.setState({
|
||||
userHasGeneratedPassword: Boolean(this._sessionStore.getCachedPassword()),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user