v1.0.32: re-assert button state after setSettings resets it

setSettings() causes Stream Deck to reset the button visual back to
its default state (state 0). The optimistic setState(1) was correct
but got overridden. Now setState(1) is called again after setSettings
completes to ensure the button stays green.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
pdmarf
2026-04-24 09:01:55 +01:00
parent a233cfc4fd
commit e3a19234a9
6 changed files with 8 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
const CURRENT_VERSION = "1.0.31";
const CURRENT_VERSION = "1.0.32";
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=
@@ -261,6 +261,8 @@ class TimerToggle extends SingletonAction<TimerSettings> {
await ev.action.setSettings(started);
this.settingsCache.set(ev.action.id, started);
await setRunningEntry(entryId);
// Re-assert state after setSettings, which can reset visual state
await Promise.all([ev.action.setState(1), ev.action.setTitle(`${title}`)]);
}
} catch (err) {
streamDeck.logger.error("Timer toggle failed:", err);