changed the topology of saves

For the file `widbgjs.settings.json`
pull/2577/head
Phil Roggenbuck 2023-02-14 21:38:32 +01:00 committed by GitHub
parent c6856ecde6
commit 9c005ca4b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -10,14 +10,14 @@
// ...and overwrite them with any saved values
// This way saved values are preserved if a new version adds more settings
const storage = require('Storage');
const d = storage.readJSON(SAVEFILE, 1) || {};
const saved = d.settings || {};
var d = storage.readJSON(SAVEFILE, 1) || {};
const saved = d || {};
for (const key in saved) {
s[key] = saved[key];
}
function save() {
d.settings = s;
d = s;
storage.write(SAVEFILE, d);
WIDGETS['widbgjs'].draw();
}