Fix scoping, add 'file' variable
parent
6d58a466b2
commit
297d8b15ac
|
|
@ -1 +0,0 @@
|
||||||
gassist.json
|
|
||||||
|
|
@ -1,14 +1,15 @@
|
||||||
let storage = require('Storage');
|
|
||||||
|
|
||||||
(function (back) {
|
(function (back) {
|
||||||
|
let storage = require('Storage');
|
||||||
|
let file = "gassist.json";
|
||||||
|
|
||||||
// Load and set default settings
|
// Load and set default settings
|
||||||
let appSettings = Object.assign({
|
let appSettings = Object.assign({
|
||||||
enableTap : true
|
enableTap : true
|
||||||
}, storage.readJSON("gassist.json", true) || {});
|
}, storage.readJSON(file, true) || {});
|
||||||
|
|
||||||
// Save settings to storage
|
// Save settings to storage
|
||||||
function writeSettings() {
|
function writeSettings() {
|
||||||
storage.writeJSON("gassist.json", appSettings);
|
storage.writeJSON(file, appSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
function showMenu() {
|
function showMenu() {
|
||||||
|
|
@ -29,4 +30,4 @@ let storage = require('Storage');
|
||||||
}
|
}
|
||||||
// Initially show the menu
|
// Initially show the menu
|
||||||
showMenu();
|
showMenu();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue