From 8260503b424873e24046815d68b3fef72ee6f8e5 Mon Sep 17 00:00:00 2001 From: Oj Date: Fri, 11 Mar 2022 08:50:36 +0000 Subject: [PATCH] [Settings] Minor source cleanup --- src/utils/Settings.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/utils/Settings.js b/src/utils/Settings.js index 9c9a44d..905a7ff 100644 --- a/src/utils/Settings.js +++ b/src/utils/Settings.js @@ -8,8 +8,7 @@ class Settings { // Heavily based on original for compat, but simplified and twe try { this.lastSaved = readFileSync(this.path); this.settings = JSON.parse(this.lastSaved); - } catch (_e) { - this.lastSaved = ''; + } catch (e) { this.settings = {}; } @@ -35,10 +34,7 @@ class Settings { // Heavily based on original for compat, but simplified and twe } save() { - if (this.lastModified && this.lastModified !== this.getLastModified()) { // File was last modified after Settings was made, so was externally edited therefore we don't save over - log('AppSettings', 'Modified date mismatch'); - return; - } + if (this.lastModified && this.lastModified !== this.getLastModified()) return; // File was last modified after Settings was made, so was externally edited therefore we don't save over try { const toSave = JSON.stringify(this.settings, null, 2);