Page MenuHomePhabricator

D9967.diff
No OneTemporary

D9967.diff

diff --git a/desktop/flow-typed/npm/electron_v22.0.0.js b/desktop/flow-typed/npm/electron_v22.0.0.js
--- a/desktop/flow-typed/npm/electron_v22.0.0.js
+++ b/desktop/flow-typed/npm/electron_v22.0.0.js
@@ -458,6 +458,10 @@
event: T,
listener: $ElementType<WebContentsEvents, T>,
): void;
+ removeListener: <T: $Keys<WebContentsEvents>>(
+ event: T,
+ listener: $ElementType<WebContentsEvents, T>,
+ ) => void;
inspectSharedWorker(): void;
}
declare type WebContentsEvents = {
diff --git a/desktop/src/main.js b/desktop/src/main.js
--- a/desktop/src/main.js
+++ b/desktop/src/main.js
@@ -226,7 +226,7 @@
const main = createMainWindow(urlPath);
let loadedSuccessfully = true;
- main.webContents.on('did-fail-load', () => {
+ const failedLoadHandler = () => {
loadedSuccessfully = false;
if (!splash.isDestroyed()) {
splash.destroy();
@@ -239,7 +239,9 @@
loadedSuccessfully = true;
main.loadURL(url);
}, 1000);
- });
+ };
+
+ main.webContents.on('did-fail-load', failedLoadHandler);
main.webContents.on('did-finish-load', () => {
if (loadedSuccessfully) {
@@ -250,6 +252,8 @@
error.destroy();
}
+ main.webContents.removeListener('did-fail-load', failedLoadHandler);
+
main.show();
if (app.isPackaged) {

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 8, 5:30 PM (21 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2444795
Default Alt Text
D9967.diff (1 KB)

Event Timeline