Update app.js

master
xxDUxx 2023-01-24 09:40:46 +01:00 committed by GitHub
parent e924934146
commit 01ada02272
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -30,7 +30,10 @@
let showExtras = function() { //show extras for a limited time let showExtras = function() { //show extras for a limited time
drawExtras(); drawExtras();
if (extrasTimeout) clearTimeout(extrasTimeout); if (extrasTimeout) clearTimeout(extrasTimeout);
extrasTimeout = setTimeout(hideExtras, 5000); extrasTimeout = setTimeout(() => {
extrasTimeout = undefined;
drawExtras();
}, 5000);
}; };
let drawExtras = function() { //draw date, day of the week and widgets let drawExtras = function() { //draw date, day of the week and widgets
let date = new Date(); let date = new Date();
@ -45,10 +48,8 @@
g.clearRect(0, 138, g.getWidth() - 1, 176); g.clearRect(0, 138, g.getWidth() - 1, 176);
require("widget_utils").hide(); require("widget_utils").hide();
extrasShown = false; extrasShown = false;
print(drawTimeout);
}; };
let draw = function() { let draw = function() {
print(process.memory().usage + " - " + drawTimeout);
let date = new Date(); let date = new Date();
g.reset(); g.reset();
if (extrasShown) drawExtras(); if (extrasShown) drawExtras();