From 7dce635e6f2f569473dcd3fecee3e7d3c99e250c Mon Sep 17 00:00:00 2001 From: lin onetwo Date: Sat, 6 Jan 2024 21:47:16 +0800 Subject: [PATCH] feat: store all settings before quit --- src/main.ts | 1 + src/preload/common/authRedirect.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index e9896c72..e18008bc 100755 --- a/src/main.ts +++ b/src/main.ts @@ -180,6 +180,7 @@ app.on( await Promise.all([ wikiService.stopAllWiki(), windowService.clearWindowsReference(), + databaseService.immediatelyStoreSettingsToFile(), ]); destroyLogger(); app.exit(0); diff --git a/src/preload/common/authRedirect.ts b/src/preload/common/authRedirect.ts index 2e538770..7395a682 100644 --- a/src/preload/common/authRedirect.ts +++ b/src/preload/common/authRedirect.ts @@ -22,7 +22,6 @@ const log = (message: string): void => { }; async function refresh(): Promise { // get path from src/constants/paths.ts - log(`constantsFetched: ${String(constantsFetched)}`); if (!constantsFetched) { await Promise.all([ context.get('CHROME_ERROR_PATH').then((pathName) => { @@ -88,6 +87,7 @@ async function refresh(): Promise { await windowService.loadURL(windowName, MAIN_WINDOW_WEBPACK_ENTRY); } } else if (window.location.href === CHROME_ERROR_PATH) { + log(`window.location.href === CHROME_ERROR_PATH`); await windowService.loadURL(windowName, MAIN_WINDOW_WEBPACK_ENTRY); } else { setTimeout(() => void refresh(), CHECK_LOADED_INTERVAL);