diff --git a/com.pdma.notion-timer.sdPlugin/bin/plugin.js b/com.pdma.notion-timer.sdPlugin/bin/plugin.js index 7662065..7ed249e 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.45"; +var CURRENT_VERSION = "1.0.46"; 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= @@ -6677,13 +6677,21 @@ var TimerToggle = class extends SingletonAction { } try { if (isRunning) { - await stopTimer(global.notionToken, memRunningEntryId); + try { + await stopTimer(global.notionToken, memRunningEntryId); + } catch (err) { + plugin_default.logger.error("Failed to stop timer in Notion (clearing local state anyway):", err); + } setRunningEntry(null, null); this.clearElapsedCheck(); await Promise.all([ev.action.setState(0), ev.action.setTitle(title)]); } else { if (memRunningEntryId) { - await stopTimer(global.notionToken, memRunningEntryId); + try { + await stopTimer(global.notionToken, memRunningEntryId); + } catch (err) { + plugin_default.logger.error("Failed to stop previous timer in Notion (clearing local state anyway):", err); + } setRunningEntry(null, null); this.clearElapsedCheck(); } diff --git a/com.pdma.notion-timer.sdPlugin/bin/plugin.js.sig b/com.pdma.notion-timer.sdPlugin/bin/plugin.js.sig index 1f31d42..0b3f985 100644 --- a/com.pdma.notion-timer.sdPlugin/bin/plugin.js.sig +++ b/com.pdma.notion-timer.sdPlugin/bin/plugin.js.sig @@ -1 +1 @@ -696’``w¾)G¶"éoÛ£šAyÍ‹xìØ“ÁÞ ¶á„ÙdG»Cv+t9ãXÅ­ü]M>IÁ¨Í–¼š²ßÁ \ No newline at end of file +%ÔC¹K$ñh­¸O×Ù~…‘cc¨'cwMá�¸þÀ›¸\ÞÝAä¨�ty"0|ÉiîbRö»/Îå„/¡ \ No newline at end of file diff --git a/notion-timer.streamDeckPlugin b/notion-timer.streamDeckPlugin index 853aae6..58010aa 100644 Binary files a/notion-timer.streamDeckPlugin and b/notion-timer.streamDeckPlugin differ diff --git a/src/plugin.ts b/src/plugin.ts index 3882eb5..6d18d42 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -1,4 +1,4 @@ -const CURRENT_VERSION = "1.0.45"; +const CURRENT_VERSION = "1.0.46"; 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= @@ -286,13 +286,25 @@ class TimerToggle extends SingletonAction { try { if (isRunning) { - await stopTimer(global.notionToken, memRunningEntryId!); + // Stopping the entry in Notion is best-effort: if the page is already + // gone/archived (e.g. edited outside the plugin) this throws, but the + // local "running" tracking must clear anyway or every future keypress + // retries this same doomed stop call and the deck gets stuck forever. + try { + await stopTimer(global.notionToken, memRunningEntryId!); + } catch (err) { + streamDeck.logger.error("Failed to stop timer in Notion (clearing local state anyway):", err); + } setRunningEntry(null, null); this.clearElapsedCheck(); await Promise.all([ev.action.setState(0), ev.action.setTitle(title)]); } else { if (memRunningEntryId) { - await stopTimer(global.notionToken, memRunningEntryId); + try { + await stopTimer(global.notionToken, memRunningEntryId); + } catch (err) { + streamDeck.logger.error("Failed to stop previous timer in Notion (clearing local state anyway):", err); + } setRunningEntry(null, null); this.clearElapsedCheck(); } diff --git a/version.json b/version.json index 1cbc25d..03c4c7f 100644 --- a/version.json +++ b/version.json @@ -1 +1 @@ -{ "version": "1.0.45" } +{ "version": "1.0.46" }