tweak welcome app to cope with no JSON

pull/191/head
Gordon Williams 2020-03-02 07:55:26 +00:00
parent 6eabd60139
commit e755d64cc1
3 changed files with 3 additions and 2 deletions

View File

@ -40,7 +40,7 @@
{ "id": "welcome",
"name": "Welcome",
"icon": "app.png",
"version":"0.03",
"version":"0.04",
"description": "Appears at first boot and explains how to use Bangle.js",
"tags": "start,welcome",
"allow_emulator":true,

View File

@ -1,3 +1,4 @@
0.01: New App!
0.02: Animate balloon intro
0.03: BTN3 now won't restart when at the end
0.04: Fix regression after tweaks to Storage.readJSON

View File

@ -283,7 +283,7 @@ setWatch(()=>move(1), BTN3, {repeat:true});
setWatch(()=>{
// If we're on the last page
if (sceneNumber == scenes.length-1) {
var settings = require("Storage").readJSON('setting.json');
var settings = require("Storage").readJSON('setting.json',1)||{};
settings.welcomed = true;
require("Storage").write('setting.json',settings);
load();