Try and fix the Notifier race
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>pull/21833/head
parent
0242b6f3f3
commit
2530ec8419
|
@ -27,8 +27,7 @@ import { _t } from './languageHandler';
|
||||||
import Modal from './Modal';
|
import Modal from './Modal';
|
||||||
import SettingsStore, {SettingLevel} from "./settings/SettingsStore";
|
import SettingsStore, {SettingLevel} from "./settings/SettingsStore";
|
||||||
import {
|
import {
|
||||||
showToast as showNotificationsToast,
|
hideToast as hideNotificationsToast, showToast as showNotificationsToast,
|
||||||
hideToast as hideNotificationsToast,
|
|
||||||
} from "./toasts/DesktopNotificationsToast";
|
} from "./toasts/DesktopNotificationsToast";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -188,10 +187,6 @@ const Notifier = {
|
||||||
MatrixClientPeg.get().on("sync", this.boundOnSyncStateChange);
|
MatrixClientPeg.get().on("sync", this.boundOnSyncStateChange);
|
||||||
this.toolbarHidden = false;
|
this.toolbarHidden = false;
|
||||||
this.isSyncing = false;
|
this.isSyncing = false;
|
||||||
|
|
||||||
if (this.shouldShowToolbar()) {
|
|
||||||
showNotificationsToast();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
stop: function() {
|
stop: function() {
|
||||||
|
|
|
@ -71,6 +71,7 @@ import {
|
||||||
showToast as showAnalyticsToast,
|
showToast as showAnalyticsToast,
|
||||||
hideToast as hideAnalyticsToast
|
hideToast as hideAnalyticsToast
|
||||||
} from "../../toasts/AnalyticsToast";
|
} from "../../toasts/AnalyticsToast";
|
||||||
|
import {showToast as showNotificationsToast} from "../../toasts/DesktopNotificationsToast";
|
||||||
|
|
||||||
/** constants for MatrixChat.state.view */
|
/** constants for MatrixChat.state.view */
|
||||||
export enum Views {
|
export enum Views {
|
||||||
|
@ -1364,6 +1365,10 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
||||||
this.firstSyncComplete = true;
|
this.firstSyncComplete = true;
|
||||||
this.firstSyncPromise.resolve();
|
this.firstSyncPromise.resolve();
|
||||||
|
|
||||||
|
if (Notifier.shouldShowToolbar()) {
|
||||||
|
showNotificationsToast();
|
||||||
|
}
|
||||||
|
|
||||||
dis.dispatch({action: 'focus_composer'});
|
dis.dispatch({action: 'focus_composer'});
|
||||||
this.setState({
|
this.setState({
|
||||||
ready: true,
|
ready: true,
|
||||||
|
|
Loading…
Reference in New Issue