Skip to content

Commit

Permalink
fix: Config issues
Browse files Browse the repository at this point in the history
  • Loading branch information
cyperdark committed Apr 28, 2024
1 parent ce0d28f commit bfe7d82
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
8 changes: 5 additions & 3 deletions packages/common/utils/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
});
};
7 changes: 4 additions & 3 deletions packages/updater/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
};

Expand Down

0 comments on commit bfe7d82

Please sign in to comment.