[MM-40635] Fix notifications and badges broken during test changes (#1934)
This commit is contained in:
@@ -104,7 +104,7 @@ const anyExpired = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// add any other event emitter methods if needed
|
// add any other event emitter methods if needed
|
||||||
export const on = status.emitter.on;
|
export const on = status.emitter.on.bind(status.emitter);
|
||||||
|
|
||||||
const setSessionExpired = (serverName: string, expired: boolean) => {
|
const setSessionExpired = (serverName: string, expired: boolean) => {
|
||||||
const isExpired = Boolean(expired);
|
const isExpired = Boolean(expired);
|
||||||
|
@@ -101,13 +101,17 @@ export class MattermostView extends EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.view.webContents.on('did-finish-load', () => {
|
this.view.webContents.on('did-finish-load', () => {
|
||||||
if (!this.view.webContents.isLoading()) {
|
// wait for screen to truly finish loading before sending the message down
|
||||||
try {
|
const timeout = setInterval(() => {
|
||||||
this.view.webContents.send(SET_VIEW_OPTIONS, this.tab.name, this.tab.shouldNotify);
|
if (!this.view.webContents.isLoading()) {
|
||||||
} catch (e) {
|
try {
|
||||||
log.error('failed to send view options to view', this.tab.name);
|
this.view.webContents.send(SET_VIEW_OPTIONS, this.tab.name, this.tab.shouldNotify);
|
||||||
|
clearTimeout(timeout);
|
||||||
|
} catch (e) {
|
||||||
|
log.error('failed to send view options to view', this.tab.name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}, 100);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.contextMenu = new ContextMenu({}, this.view);
|
this.contextMenu = new ContextMenu({}, this.view);
|
||||||
|
Reference in New Issue
Block a user