[MM-40192] Don't send message until server is finished reloading (#1886)

* [MM-40192] Don't send message until server is finished reloading

* Error check
This commit is contained in:
Devin Binnie
2021-12-09 12:44:44 -05:00
committed by GitHub
parent 4a98dce51e
commit 850eadceb9

View File

@@ -100,7 +100,13 @@ export class MattermostView extends EventEmitter {
}
this.view.webContents.on('did-finish-load', () => {
this.view.webContents.send(SET_VIEW_OPTIONS, this.tab.name, this.tab.shouldNotify);
if (!this.view.webContents.isLoading()) {
try {
this.view.webContents.send(SET_VIEW_OPTIONS, this.tab.name, this.tab.shouldNotify);
} catch (e) {
log.error('failed to send view options to view', this.tab.name);
}
}
});
this.contextMenu = new ContextMenu({}, this.view);