Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3175242
D9967.id33662.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D9967.id33662.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 8, 7:40 PM (21 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2444795
Default Alt Text
D9967.id33662.diff (1 KB)
Attached To
Mode
D9967: [desktop] Unregister did-fail-load event after startup
Attached
Detach File
Event Timeline
Log In to Comment