v1.0.44: clear tracked running state immediately after stopping old timer

Found while testing v1.0.43's icon self-heal: when switching from one
running timer to another, the old Notion entry was stopped but
memRunningActionId/EntryId weren't cleared until AFTER the new
startTimer call resolved. During that gap, a blocked press on the
just-stopped button read the stale (not-yet-cleared) tracked id and
self-healed itself back to a wrongly-'running' green — reinforcing
the exact staleness the self-heal was meant to fix. Now cleared to
null the moment the old timer is actually stopped.
This commit is contained in:
pdmarf
2026-08-25 16:34:38 +01:00
parent 45201bc376
commit 2e2f2553ac
4 changed files with 6 additions and 6 deletions
+2 -1
View File
@@ -6438,7 +6438,7 @@ async function stopTimer(token, entryId) {
}
// src/plugin.ts
var CURRENT_VERSION = "1.0.43";
var CURRENT_VERSION = "1.0.44";
var GITEA_BASE = "https://gitea.pdmarf.co.uk/pdm/stream_deck_notion_timer/raw/branch/stable-rebuild";
var SIGNING_PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----
MCowBQYDK2VwAyEAN7ko8TUpuPzPAJuKAZCRjV0c4ZSlou5d9pUAF6o12b4=
@@ -6683,6 +6683,7 @@ var TimerToggle = class extends SingletonAction {
} else {
if (memRunningEntryId) {
await stopTimer(global.notionToken, memRunningEntryId);
setRunningEntry(null, null);
this.clearElapsedCheck();
}
const entryId = await startTimer(global.notionToken, global.timingDbId, projectId, projectName, global.userId);