pull/2974/head
Dennis Kueper 2023-08-16 09:06:18 +02:00
parent 0fb770795f
commit 8715e0df92
1 changed files with 8 additions and 5 deletions

View File

@ -1,22 +1,25 @@
{ // must be inside our own scope here so that when we are unloaded everything disappears
g.clear();
let confirm = false;
let confirmed = false;
let settings = require('Storage').readJSON("poweroff.json", true) || {};
let showPrompt;
showPrompt = def(settings.showPrompt, true);
E.showPrompt('Are you sure?', {
if (showPrompt) {
E.showPrompt('Are you sure?', {
title: 'Power off',
buttons: { Yes: true, No: false },
}).then((confirm) => {
}).then((confirm) => {
if (!confirm) {
setTimeout(load, 100);
confirmed = true;
return;
}
});
});
}
if (showPrompt && confirm) {
if (!showPrompt || confirmed) {
g.setFont("6x8",2).setFontAlign(0,0);
var x = g.getWidth()/2;
var y = g.getHeight()/2 + 10;