v1.0.43: self-heal stale button icon when blocked by the keyDown lock
When a keyDown is blocked by the v1.0.42 lock, redraw that button to match memRunningActionId instead of leaving whatever it was already showing. This closes the follow-on issue found while testing 1.0.42: a button's key image can go stale if its Notion timer was ever stopped/started outside the plugin (e.g. a manual Notion edit), and a blocked press was leaving that stale image in place — misleading the user into thinking a timer was running when it wasn't, which then caused a *real* unintended timer start on the next press.
This commit is contained in:
@@ -6438,7 +6438,7 @@ async function stopTimer(token, entryId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// src/plugin.ts
|
// src/plugin.ts
|
||||||
var CURRENT_VERSION = "1.0.42";
|
var CURRENT_VERSION = "1.0.43";
|
||||||
var GITEA_BASE = "https://gitea.pdmarf.co.uk/pdm/stream_deck_notion_timer/raw/branch/stable-rebuild";
|
var GITEA_BASE = "https://gitea.pdmarf.co.uk/pdm/stream_deck_notion_timer/raw/branch/stable-rebuild";
|
||||||
var SIGNING_PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----
|
var SIGNING_PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----
|
||||||
MCowBQYDK2VwAyEAN7ko8TUpuPzPAJuKAZCRjV0c4ZSlou5d9pUAF6o12b4=
|
MCowBQYDK2VwAyEAN7ko8TUpuPzPAJuKAZCRjV0c4ZSlou5d9pUAF6o12b4=
|
||||||
@@ -6637,7 +6637,15 @@ var TimerToggle = class extends SingletonAction {
|
|||||||
await sendProjectsToPI();
|
await sendProjectsToPI();
|
||||||
}
|
}
|
||||||
async onKeyDown(ev) {
|
async onKeyDown(ev) {
|
||||||
if (this.keyDownBusy) return;
|
if (this.keyDownBusy) {
|
||||||
|
const title = buttonTitle(ev.payload.settings.projectName || "");
|
||||||
|
const shouldBeRunning = memRunningActionId === ev.action.id;
|
||||||
|
await Promise.all([
|
||||||
|
ev.action.setState(shouldBeRunning ? 1 : 0),
|
||||||
|
ev.action.setTitle(shouldBeRunning ? `\u23F1 ${title}` : title)
|
||||||
|
]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.keyDownBusy = true;
|
this.keyDownBusy = true;
|
||||||
try {
|
try {
|
||||||
const { projectId, projectName } = ev.payload.settings;
|
const { projectId, projectName } = ev.payload.settings;
|
||||||
|
|||||||
@@ -1 +1,3 @@
|
|||||||
HeÒ¾à�¡21™ßC'Ý—ÿ9ƒx¤,$2&úöö¡rÅYËb’L¸ËeìÉ.ËQ:¶þõub;B™¢&
|
íü„«ÚƒJºh^©A׊[ÈÍ
|
||||||
|
Ìg»Jµmã
|
||||||
|
SÙ¹mš']ï´y�j$¬<ÎÇÙÃ5ef«?eó=™y–
|
||||||
+13
-2
@@ -1,4 +1,4 @@
|
|||||||
const CURRENT_VERSION = "1.0.42";
|
const CURRENT_VERSION = "1.0.43";
|
||||||
const GITEA_BASE = "https://gitea.pdmarf.co.uk/pdm/stream_deck_notion_timer/raw/branch/stable-rebuild";
|
const GITEA_BASE = "https://gitea.pdmarf.co.uk/pdm/stream_deck_notion_timer/raw/branch/stable-rebuild";
|
||||||
const SIGNING_PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----
|
const SIGNING_PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----
|
||||||
MCowBQYDK2VwAyEAN7ko8TUpuPzPAJuKAZCRjV0c4ZSlou5d9pUAF6o12b4=
|
MCowBQYDK2VwAyEAN7ko8TUpuPzPAJuKAZCRjV0c4ZSlou5d9pUAF6o12b4=
|
||||||
@@ -243,7 +243,18 @@ class TimerToggle extends SingletonAction<TimerSettings> {
|
|||||||
// Global lock across ALL buttons of this action, not just this one — otherwise
|
// Global lock across ALL buttons of this action, not just this one — otherwise
|
||||||
// near-simultaneous presses on two different buttons both read memRunningActionId
|
// near-simultaneous presses on two different buttons both read memRunningActionId
|
||||||
// as "nothing running" and both start a timer in Notion.
|
// as "nothing running" and both start a timer in Notion.
|
||||||
if (this.keyDownBusy) return;
|
if (this.keyDownBusy) {
|
||||||
|
// Blocked press: redraw THIS button to match known truth instead of leaving
|
||||||
|
// whatever it was already showing (which can be stale from an out-of-band
|
||||||
|
// Notion edit) — a pure visual correction, no Notion calls.
|
||||||
|
const title = buttonTitle(ev.payload.settings.projectName || "");
|
||||||
|
const shouldBeRunning = memRunningActionId === ev.action.id;
|
||||||
|
await Promise.all([
|
||||||
|
ev.action.setState(shouldBeRunning ? 1 : 0),
|
||||||
|
ev.action.setTitle(shouldBeRunning ? `⏱ ${title}` : title),
|
||||||
|
]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.keyDownBusy = true;
|
this.keyDownBusy = true;
|
||||||
try {
|
try {
|
||||||
const { projectId, projectName } = ev.payload.settings;
|
const { projectId, projectName } = ev.payload.settings;
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
{ "version": "1.0.42" }
|
{ "version": "1.0.43" }
|
||||||
|
|||||||
Reference in New Issue
Block a user