summaryrefslogtreecommitdiffhomepage
path: root/gui/src
diff options
context:
space:
mode:
Diffstat (limited to 'gui/src')
-rw-r--r--gui/src/main/gui-settings.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/gui/src/main/gui-settings.ts b/gui/src/main/gui-settings.ts
index 54b51116cd..23d2e4ced8 100644
--- a/gui/src/main/gui-settings.ts
+++ b/gui/src/main/gui-settings.ts
@@ -90,7 +90,13 @@ export default class GuiSettings {
...this.validateSettings(rawJson),
};
} catch (error) {
- log.error(`Failed to read GUI settings file: ${error}`);
+ // Read settings if the file exists, otherwise write the default settings to it.
+ if (error.code === 'ENOENT') {
+ log.debug('Creating gui-settings file and writing the default settings to it');
+ this.store();
+ } else {
+ log.error(`Failed to read GUI settings file: ${error}`);
+ }
}
}