Skip to content

Commit

Permalink
fix: fallback to default settings
Browse files Browse the repository at this point in the history
  • Loading branch information
duzda committed Aug 17, 2024
1 parent 0025baf commit 1ad43f9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ const loadFromFile = async (file: string) => {
if (!err) {
currentSettings = JSON.parse(data);

Object.entries(DEFAULT_SETTINGS).forEach(([key, value]) => {
if (currentSettings[key as keyof Settings] === undefined) {
currentSettings[key as keyof Settings] = value as never;
}
});

OnSet.enableTray(currentSettings.enableTray);
OnSet.closeToTray(currentSettings.closeToTray);
OnSet.deemixIntegration(currentSettings.deemixIntegration);
Expand Down

0 comments on commit 1ad43f9

Please sign in to comment.