Skip to content

Commit

Permalink
Don't create empty settings_old folder for fresh installs (#2735)
Browse files Browse the repository at this point in the history
  • Loading branch information
RunDevelopment committed Apr 4, 2024
1 parent 2dd3d88 commit a63c652
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/setting-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ export const readSettings = (): ChainnerSettings => {

// legacy settings
const storagePath = path.join(getRootDirSync(), 'settings');
if (!existsSync(storagePath)) {
// neither settings.json nor old settings exist, so this is a fresh install
return { ...defaultSettings };
}

const storage = new LocalStorage(storagePath);
const partialSettings = migrateOldStorageSettings({
keys: Array.from({ length: storage.length }, (_, i) => storage.key(i)),
Expand Down

0 comments on commit a63c652

Please sign in to comment.