From 297d8b15acb55b34afd48fb350f60dbaa6412e58 Mon Sep 17 00:00:00 2001 From: stweedo Date: Thu, 29 Jun 2023 12:25:38 -0500 Subject: [PATCH] Fix scoping, add 'file' variable --- apps/gassist/gassist.json | 1 - apps/gassist/settings.js | 11 ++++++----- 2 files changed, 6 insertions(+), 6 deletions(-) delete mode 100644 apps/gassist/gassist.json diff --git a/apps/gassist/gassist.json b/apps/gassist/gassist.json deleted file mode 100644 index 26c61fc04..000000000 --- a/apps/gassist/gassist.json +++ /dev/null @@ -1 +0,0 @@ -gassist.json \ No newline at end of file diff --git a/apps/gassist/settings.js b/apps/gassist/settings.js index f264d99fa..987c3fdfc 100644 --- a/apps/gassist/settings.js +++ b/apps/gassist/settings.js @@ -1,14 +1,15 @@ -let storage = require('Storage'); - (function (back) { + let storage = require('Storage'); + let file = "gassist.json"; + // Load and set default settings let appSettings = Object.assign({ enableTap : true - }, storage.readJSON("gassist.json", true) || {}); + }, storage.readJSON(file, true) || {}); // Save settings to storage function writeSettings() { - storage.writeJSON("gassist.json", appSettings); + storage.writeJSON(file, appSettings); } function showMenu() { @@ -29,4 +30,4 @@ let storage = require('Storage'); } // Initially show the menu showMenu(); -}); \ No newline at end of file +});