mirror of https://github.com/espruino/BangleApps
fix file-not-found issue during the first boot
parent
171b7d1fce
commit
56ea00dc31
|
@ -5,4 +5,4 @@
|
||||||
0.05: Add display for the next strike time
|
0.05: Add display for the next strike time
|
||||||
0.06: Move the next strike time to the first row of display
|
0.06: Move the next strike time to the first row of display
|
||||||
0.07: Change the boot function to avoid reloading the entire watch
|
0.07: Change the boot function to avoid reloading the entire watch
|
||||||
0.08: Default to no strikes.
|
0.08: Default to no strikes. Fix file-not-found issue during the first boot.
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
(function() {
|
(function() {
|
||||||
function setup () {
|
function setup () {
|
||||||
var settings = require('Storage').readJSON('hourstrike.json',1)||[];
|
var settings = require('Storage').readJSON('hourstrike.json',1)||[];
|
||||||
|
if (!settings) resetSettings();
|
||||||
var t = new Date();
|
var t = new Date();
|
||||||
var t_min_sec = t.getMinutes()*60+t.getSeconds();
|
var t_min_sec = t.getMinutes()*60+t.getSeconds();
|
||||||
var wait_msec = settings.interval>0?(settings.interval-t_min_sec%settings.interval)*1000:-1;
|
var wait_msec = settings.interval>0?(settings.interval-t_min_sec%settings.interval)*1000:-1;
|
||||||
|
|
Loading…
Reference in New Issue