diff options
| author | Danilo M. <danix@danix.xyz> | 2026-11-12 09:01:06 +0100 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-11-12 09:01:06 +0100 |
| commit | 512a2b4a2821a1edadf5530d060e3ae5468d75e8 (patch) | |
| tree | f81dcb1d2238403bdcf68cf9298cc34b6a010672 /static/app.js | |
| parent | fea2e9b221a2d18f9c73e5763adf662128cea5ec (diff) | |
| download | deck-it-512a2b4a2821a1edadf5530d060e3ae5468d75e8.tar.gz deck-it-512a2b4a2821a1edadf5530d060e3ae5468d75e8.zip | |
fix(tablet): restore the backlight after a restart or shutdown
The server never ran the modules' stop: `deck-it stop` ends it with
SIGTERM and nothing called stop_all, so a shutdown left the tablet dim.
A SIGTERM handler now runs stop_all before exiting.
The settings from before a dim lived only in memory, so a new server's
undim had nothing to put back. They are now kept in
~/.cache/deck-it/dim, and a freshly loaded page asks for undim, since it
is never dimmed itself.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'static/app.js')
| -rw-r--r-- | static/app.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/static/app.js b/static/app.js index b824667..cbc0f0a 100644 --- a/static/app.js +++ b/static/app.js @@ -284,7 +284,8 @@ function touched() { } dimmer.addEventListener("click", () => { dimmer.hidden = true; tablet("undim"); }); document.addEventListener("pointerdown", touched, true); -fetch("/api/tablet").then((r) => r.json()).then((t) => { dimAfter = t.dim_after ?? 0; touched(); }).catch(() => {}); +// A fresh page is not dimmed, so a dim left by an earlier server goes too. +fetch("/api/tablet").then((r) => r.json()).then((t) => { dimAfter = t.dim_after ?? 0; tablet("undim"); touched(); }).catch(() => {}); document.addEventListener("visibilitychange", () => { if (document.visibilityState === "visible") { |
