diff --git a/com.pdma.notion-timer.sdPlugin/bin/plugin.js b/com.pdma.notion-timer.sdPlugin/bin/plugin.js index 29dcf3e..0aecbf0 100644 --- a/com.pdma.notion-timer.sdPlugin/bin/plugin.js +++ b/com.pdma.notion-timer.sdPlugin/bin/plugin.js @@ -6438,7 +6438,7 @@ async function stopTimer(token, entryId) { } // src/plugin.ts -var CURRENT_VERSION = "1.0.41"; +var CURRENT_VERSION = "1.0.42"; 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= @@ -6587,7 +6587,7 @@ Should it continue?" buttons {"Stop", "Continue"} default button "Continue" givi } var TimerToggle = class extends SingletonAction { projectCache = /* @__PURE__ */ new Map(); - pendingKeyDown = /* @__PURE__ */ new Set(); + keyDownBusy = false; elapsedCheckTimer = null; clearElapsedCheck() { if (this.elapsedCheckTimer) clearTimeout(this.elapsedCheckTimer); @@ -6637,8 +6637,8 @@ var TimerToggle = class extends SingletonAction { await sendProjectsToPI(); } async onKeyDown(ev) { - if (this.pendingKeyDown.has(ev.action.id)) return; - this.pendingKeyDown.add(ev.action.id); + if (this.keyDownBusy) return; + this.keyDownBusy = true; try { const { projectId, projectName } = ev.payload.settings; const title = buttonTitle(projectName || ""); @@ -6691,7 +6691,7 @@ var TimerToggle = class extends SingletonAction { await ev.action.showAlert(); } } finally { - this.pendingKeyDown.delete(ev.action.id); + this.keyDownBusy = false; } } }; diff --git a/com.pdma.notion-timer.sdPlugin/bin/plugin.js.sig b/com.pdma.notion-timer.sdPlugin/bin/plugin.js.sig index a10a57b..b626d78 100644 --- a/com.pdma.notion-timer.sdPlugin/bin/plugin.js.sig +++ b/com.pdma.notion-timer.sdPlugin/bin/plugin.js.sig @@ -1,2 +1 @@ -â /}‚Ï‘I]�“v¶¤6Ä®[cV”+ûäù™>f&6š$ -ú¹ú«b;šÐŒàø»@ôÄb}©ò&X \ No newline at end of file +HeÒ¾à�¡21™ßC'Ý—ÿ9ƒx¤,$2&úöö¡rÅYËb’L¸ËeìÉ.ËQ:¶þõub;B™¢& \ No newline at end of file diff --git a/src/plugin.ts b/src/plugin.ts index 05fc141..a42f5aa 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -1,4 +1,4 @@ -const CURRENT_VERSION = "1.0.41"; +const CURRENT_VERSION = "1.0.42"; const GITEA_BASE = "https://gitea.pdmarf.co.uk/pdm/stream_deck_notion_timer/raw/branch/stable-rebuild"; const SIGNING_PUBLIC_KEY = `-----BEGIN PUBLIC KEY----- MCowBQYDK2VwAyEAN7ko8TUpuPzPAJuKAZCRjV0c4ZSlou5d9pUAF6o12b4= @@ -182,7 +182,7 @@ async function promptContinue(title: string): Promise<"stop" | "continue" | "tim @action({ UUID: "com.pdma.notion-timer.toggle" }) class TimerToggle extends SingletonAction { private projectCache = new Map(); - private pendingKeyDown = new Set(); + private keyDownBusy = false; private elapsedCheckTimer: NodeJS.Timeout | null = null; private clearElapsedCheck(): void { @@ -240,8 +240,11 @@ class TimerToggle extends SingletonAction { } async onKeyDown(ev: KeyDownEvent): Promise { - if (this.pendingKeyDown.has(ev.action.id)) return; - this.pendingKeyDown.add(ev.action.id); + // Global lock across ALL buttons of this action, not just this one — otherwise + // near-simultaneous presses on two different buttons both read memRunningActionId + // as "nothing running" and both start a timer in Notion. + if (this.keyDownBusy) return; + this.keyDownBusy = true; try { const { projectId, projectName } = ev.payload.settings; const title = buttonTitle(projectName || ""); @@ -293,7 +296,7 @@ class TimerToggle extends SingletonAction { await ev.action.showAlert(); } } finally { - this.pendingKeyDown.delete(ev.action.id); + this.keyDownBusy = false; } } } diff --git a/version.json b/version.json index 315992c..ff87f4e 100644 --- a/version.json +++ b/version.json @@ -1 +1 @@ -{ "version": "1.0.41" } +{ "version": "1.0.42" }