From 835d7bfb9ddfd7a777659af5c2071cbb7134b7ae Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 19 Sep 2019 17:16:57 +0100 Subject: [PATCH] Fix origin migrator for SSO logins For some reason this was trying to close the same window twice when the app was reloaded after an SSO login. Possibly also a problem on electron < 6 - presumably a race condition. --- electron_app/src/originMigrator.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/electron_app/src/originMigrator.js b/electron_app/src/originMigrator.js index 58bb0feb9..bc6acfabd 100644 --- a/electron_app/src/originMigrator.js +++ b/electron_app/src/originMigrator.js @@ -33,7 +33,7 @@ async function migrateFromOldOrigin() { webgl: false, }, }); - ipcMain.on('origin_migration_complete', (e, success, sentSummary, storedSummary) => { + ipcMain.once('origin_migration_complete', (e, success, sentSummary, storedSummary) => { if (success) { console.log("Origin migration completed successfully!"); } else { @@ -44,7 +44,7 @@ async function migrateFromOldOrigin() { migrateWindow.close(); resolve(); }); - ipcMain.on('origin_migration_nodata', (e) => { + ipcMain.once('origin_migration_nodata', (e) => { console.log("No session to migrate from old origin"); migrateWindow.close(); resolve();