diff --git a/com.pdma.notion-timer.sdPlugin/bin/plugin.js b/com.pdma.notion-timer.sdPlugin/bin/plugin.js index 1ae1597..14e91b5 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.35"; +var CURRENT_VERSION = "1.0.36"; 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= @@ -6625,8 +6625,8 @@ var TimerToggle = class extends SingletonAction { const stopped = { ...ev.payload.settings, activeEntryId: null }; await ev.action.setSettings(stopped); this.settingsCache.set(ev.action.id, stopped); - await setRunningEntry(null); await Promise.all([ev.action.setState(0), ev.action.setTitle(title)]); + await setRunningEntry(null); } else { const prevEntryId = await getRunningEntryId(); if (prevEntryId) { @@ -6651,8 +6651,8 @@ var TimerToggle = class extends SingletonAction { const started = { ...ev.payload.settings, activeEntryId: entryId }; await ev.action.setSettings(started); this.settingsCache.set(ev.action.id, started); - await setRunningEntry(entryId); await Promise.all([ev.action.setState(1), ev.action.setTitle(`\u23F1 ${title}`)]); + await setRunningEntry(entryId); } } catch (err) { await Promise.all([ev.action.setState(activeEntryId ? 1 : 0), ev.action.setTitle(activeEntryId ? `\u23F1 ${title}` : title)]); diff --git a/com.pdma.notion-timer.sdPlugin/bin/plugin.js.sig b/com.pdma.notion-timer.sdPlugin/bin/plugin.js.sig index 2fc381f..530bb5d 100644 --- a/com.pdma.notion-timer.sdPlugin/bin/plugin.js.sig +++ b/com.pdma.notion-timer.sdPlugin/bin/plugin.js.sig @@ -1,2 +1,2 @@ -x3:b ' - A!ɨol&ho۔c`5^LB'#9PIS{ \ No newline at end of file +Yxek*o +h@= \ No newline at end of file diff --git a/com.pdma.notion-timer.sdPlugin/manifest.json b/com.pdma.notion-timer.sdPlugin/manifest.json index 810de30..66fe687 100644 --- a/com.pdma.notion-timer.sdPlugin/manifest.json +++ b/com.pdma.notion-timer.sdPlugin/manifest.json @@ -2,7 +2,7 @@ "Author": "Pete Marfleet", "Description": "Toggle Notion time tracking for a project with a single button press.", "Name": "Notion Timer", - "Version": "1.0.35", + "Version": "1.0.36", "SDKVersion": 2, "Software": { "MinimumVersion": "5.0" }, "OS": [{ "Platform": "mac", "MinimumVersion": "10.11" }], diff --git a/notion-timer.streamDeckPlugin b/notion-timer.streamDeckPlugin index 97bfa1e..36eeeed 100644 Binary files a/notion-timer.streamDeckPlugin and b/notion-timer.streamDeckPlugin differ diff --git a/src/plugin.ts b/src/plugin.ts index fda3919..b21f2cd 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -1,4 +1,4 @@ -const CURRENT_VERSION = "1.0.35"; +const CURRENT_VERSION = "1.0.36"; 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= @@ -237,9 +237,9 @@ class TimerToggle extends SingletonAction { const stopped = { ...ev.payload.settings, activeEntryId: null }; await ev.action.setSettings(stopped); this.settingsCache.set(ev.action.id, stopped); - await setRunningEntry(null); - // Re-assert after setSettings resets visual state + // Re-assert immediately — before setRunningEntry's async calls await Promise.all([ev.action.setState(0), ev.action.setTitle(title)]); + await setRunningEntry(null); } else { const prevEntryId = await getRunningEntryId(); @@ -267,9 +267,9 @@ class TimerToggle extends SingletonAction { const started = { ...ev.payload.settings, activeEntryId: entryId }; await ev.action.setSettings(started); this.settingsCache.set(ev.action.id, started); - await setRunningEntry(entryId); - // Re-assert after setSettings resets visual state + // Re-assert immediately — before setRunningEntry's async calls await Promise.all([ev.action.setState(1), ev.action.setTitle(`⏱ ${title}`)]); + await setRunningEntry(entryId); } } catch (err) { // Revert optimistic visual on error diff --git a/version.json b/version.json index bb146ad..e96f7f9 100644 --- a/version.json +++ b/version.json @@ -1 +1 @@ -{ "version": "1.0.35" } +{ "version": "1.0.36" }