mirror of https://github.com/espruino/BangleApps
fix
parent
c4ced443e0
commit
0fb770795f
|
@ -1,20 +1,22 @@
|
|||
{ // must be inside our own scope here so that when we are unloaded everything disappears
|
||||
g.clear();
|
||||
|
||||
let confirm = false;
|
||||
let settings = require('Storage').readJSON("poweroff.json", true) || {};
|
||||
let showPrompt;
|
||||
showPrompt = def(settings.showPrompt, true);
|
||||
|
||||
if (showPrompt) {
|
||||
E.showPrompt('Are you sure?', {
|
||||
E.showPrompt('Are you sure?', {
|
||||
title: 'Power off',
|
||||
buttons: { Yes: true, No: false },
|
||||
}).then((confirm) => {
|
||||
}).then((confirm) => {
|
||||
if (!confirm) {
|
||||
setTimeout(load, 100);
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (showPrompt && confirm) {
|
||||
g.setFont("6x8",2).setFontAlign(0,0);
|
||||
var x = g.getWidth()/2;
|
||||
var y = g.getHeight()/2 + 10;
|
||||
|
@ -23,7 +25,7 @@ if (showPrompt) {
|
|||
setTimeout(function() {
|
||||
if (Bangle.softOff) Bangle.softOff(); else Bangle.off();
|
||||
}, 1000);
|
||||
});
|
||||
}
|
||||
|
||||
Bangle.loadWidgets();
|
||||
Bangle.drawWidgets();
|
||||
|
|
Loading…
Reference in New Issue