From bfe7d82c011af452d845796be6a7789ff802fc7d Mon Sep 17 00:00:00 2001 From: ck <21735205+cyperdark@users.noreply.github.com> Date: Mon, 29 Apr 2024 00:20:59 +0300 Subject: [PATCH] fix: Config issues --- packages/common/utils/config.ts | 8 +++++--- packages/updater/index.ts | 7 ++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/common/utils/config.ts b/packages/common/utils/config.ts index 2640f296..5f96b2c5 100644 --- a/packages/common/utils/config.ts +++ b/packages/common/utils/config.ts @@ -233,10 +233,11 @@ export const refreshConfig = (httpServer: any, refresh: boolean) => { enableGosuOverlay === true && updated === true ) { - config.enableGosuOverlay = enableGosuOverlay; osuInstances[0].injectGameOverlay(); } + config.enableGosuOverlay = enableGosuOverlay; + config.debugLogging = debugLogging; config.calculatePP = calculatePP; config.enableKeyOverlay = enableKeyOverlay; @@ -301,6 +302,7 @@ export const writeConfig = (httpServer: any, options: any) => { : config.staticFolderPath }\n`; - fs.writeFileSync(configPath, text, 'utf8'); - refreshConfig(httpServer, true); + fs.writeFile(configPath, text, 'utf8', () => { + refreshConfig(httpServer, true); + }); }; diff --git a/packages/updater/index.ts b/packages/updater/index.ts index 0a37c7d2..8feb7c4b 100644 --- a/packages/updater/index.ts +++ b/packages/updater/index.ts @@ -58,15 +58,16 @@ export const checkUpdates = async () => { name: string; assets: { name: string; browser_download_url: string }[]; } = json; + + config.currentVersion = currentVersion; + config.updateVersion = versionName || currentVersion; + if (versionName === null) { wLogger.info(`Failed to check updates [${currentVersion}] `); return new Error('Version the same'); } - config.currentVersion = currentVersion; - config.updateVersion = versionName; - return { assets, versionName, platformType }; };