mirror of https://github.com/espruino/BangleApps
Support updated settings file
parent
7a9b64a7fd
commit
60a8c487ad
|
@ -10,8 +10,9 @@ const calculating = "Calculating";
|
||||||
const notokens = "No tokens";
|
const notokens = "No tokens";
|
||||||
const notsupported = "Not supported";
|
const notsupported = "Not supported";
|
||||||
|
|
||||||
var tokens = require("Storage").readJSON("authentiwatch.json", true) || {data:[],count:0};
|
var settings = require("Storage").readJSON("authentiwatch.json", true) || {tokens:[],misc:{}};
|
||||||
tokens = tokens.data;
|
if (settings.data ) tokens = settings.data ; /* v0.02 settings */
|
||||||
|
if (settings.tokens) tokens = settings.tokens; /* v0.03+ settings */
|
||||||
|
|
||||||
// QR Code Text
|
// QR Code Text
|
||||||
//
|
//
|
||||||
|
@ -272,8 +273,8 @@ function onSwipe(e) {
|
||||||
}
|
}
|
||||||
if (e == -1 && state.curtoken != -1 && tokens[state.curtoken].period <= 0) {
|
if (e == -1 && state.curtoken != -1 && tokens[state.curtoken].period <= 0) {
|
||||||
tokens[state.curtoken].period--;
|
tokens[state.curtoken].period--;
|
||||||
let save={data:tokens,count:tokens.length};
|
let newsettings={tokens:tokens,misc:settings.misc};
|
||||||
require("Storage").writeJSON("authentiwatch.json", save);
|
require("Storage").writeJSON("authentiwatch.json", newsettings);
|
||||||
state.nextTime = 0;
|
state.nextTime = 0;
|
||||||
state.otp = "";
|
state.otp = "";
|
||||||
state.hide = 2;
|
state.hide = 2;
|
||||||
|
|
Loading…
Reference in New Issue