v1.0.36: eliminate blue flash between setSettings and setState

setState was being called after setRunningEntry, which makes two
async global settings calls and takes ~1 second. During that time
the button sat in the blue reset state from setSettings. Now
setState is called immediately after setSettings, before
setRunningEntry, so the blue flash is imperceptibly brief.

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

View File

@@ -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)]);

View File

@@ -1,2 +1,2 @@
x3:Œb™ <EFBFBD>
«… <EFBFBD>…A!úɨ½ol<6F>ž&ÊhoÛ”c±`5^LBœ'#9«PISïó{ Á‰
Yx<■bМwHW.Eш?сI* ║╘%g╘жЮтр>eШаk╡╒Н┤*иГ╨o
hг@÷╘╚╞=л

View File

@@ -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" }],