Delay Notifier
check until we have push rules
The `Notifier` class expects push rules to be available, so it can explode in strange ways if called too early. This changes to wait until the sync is in the `PREPARED` state (when push rules should be ready) before using the `Notifier`. Fixes https://github.com/vector-im/riot-web/issues/9323
This commit is contained in:
parent
a326c83016
commit
6e79cbc092
1 changed files with 6 additions and 4 deletions
|
@ -198,7 +198,7 @@ export default React.createClass({
|
||||||
|
|
||||||
syncError: null, // If the current syncing status is ERROR, the error object, otherwise null.
|
syncError: null, // If the current syncing status is ERROR, the error object, otherwise null.
|
||||||
resizeNotifier: new ResizeNotifier(),
|
resizeNotifier: new ResizeNotifier(),
|
||||||
showNotifierToolbar: Notifier.shouldShowToolbar(),
|
showNotifierToolbar: false,
|
||||||
};
|
};
|
||||||
return s;
|
return s;
|
||||||
},
|
},
|
||||||
|
@ -1197,8 +1197,7 @@ export default React.createClass({
|
||||||
* Called when a new logged in session has started
|
* Called when a new logged in session has started
|
||||||
*/
|
*/
|
||||||
_onLoggedIn: async function() {
|
_onLoggedIn: async function() {
|
||||||
this.setStateForNewView({view: VIEWS.LOGGED_IN});
|
this.setStateForNewView({ view: VIEWS.LOGGED_IN });
|
||||||
this.setState({showNotifierToolbar: Notifier.shouldShowToolbar()});
|
|
||||||
if (this._is_registered) {
|
if (this._is_registered) {
|
||||||
this._is_registered = false;
|
this._is_registered = false;
|
||||||
|
|
||||||
|
@ -1342,7 +1341,10 @@ export default React.createClass({
|
||||||
self.firstSyncPromise.resolve();
|
self.firstSyncPromise.resolve();
|
||||||
|
|
||||||
dis.dispatch({action: 'focus_composer'});
|
dis.dispatch({action: 'focus_composer'});
|
||||||
self.setState({ready: true});
|
self.setState({
|
||||||
|
ready: true,
|
||||||
|
showNotifierToolbar: Notifier.shouldShowToolbar(),
|
||||||
|
});
|
||||||
});
|
});
|
||||||
cli.on('Call.incoming', function(call) {
|
cli.on('Call.incoming', function(call) {
|
||||||
// we dispatch this synchronously to make sure that the event
|
// we dispatch this synchronously to make sure that the event
|
||||||
|
|
Loading…
Reference in a new issue