Compare commits
2 Commits
ea15f72215
...
7e66939fdb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7e66939fdb | ||
|
|
93616d3a1a |
@@ -6438,7 +6438,7 @@ async function stopTimer(token, entryId) {
|
||||
}
|
||||
|
||||
// src/plugin.ts
|
||||
var CURRENT_VERSION = "1.0.33";
|
||||
var CURRENT_VERSION = "1.0.34";
|
||||
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=
|
||||
@@ -6599,6 +6599,13 @@ var TimerToggle = class extends SingletonAction {
|
||||
if (activeEntryId) {
|
||||
await Promise.all([ev.action.setState(0), ev.action.setTitle(title)]);
|
||||
} else {
|
||||
for (const other of this.actions) {
|
||||
if (other.id === ev.action.id) continue;
|
||||
const otherSettings = this.settingsCache.get(other.id);
|
||||
if (otherSettings?.activeEntryId) {
|
||||
await Promise.all([other.setState(0), other.setTitle(buttonTitle(otherSettings.projectName || ""))]);
|
||||
}
|
||||
}
|
||||
await Promise.all([ev.action.setState(1), ev.action.setTitle(`\u23F1 ${title}`)]);
|
||||
}
|
||||
}
|
||||
@@ -6622,13 +6629,6 @@ var TimerToggle = class extends SingletonAction {
|
||||
} else {
|
||||
const prevEntryId = await getRunningEntryId();
|
||||
if (prevEntryId) {
|
||||
for (const other of this.actions) {
|
||||
if (other.id === ev.action.id) continue;
|
||||
const otherSettings = this.settingsCache.get(other.id);
|
||||
if (otherSettings?.activeEntryId === prevEntryId) {
|
||||
await Promise.all([other.setState(0), other.setTitle(buttonTitle(otherSettings.projectName || ""))]);
|
||||
}
|
||||
}
|
||||
await stopTimer(global.notionToken, prevEntryId);
|
||||
for (const other of this.actions) {
|
||||
if (other.id === ev.action.id) continue;
|
||||
|
||||
Binary file not shown.
@@ -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.33",
|
||||
"Version": "1.0.34",
|
||||
"SDKVersion": 2,
|
||||
"Software": { "MinimumVersion": "5.0" },
|
||||
"OS": [{ "Platform": "mac", "MinimumVersion": "10.11" }],
|
||||
|
||||
Binary file not shown.
@@ -1,4 +1,4 @@
|
||||
const CURRENT_VERSION = "1.0.33";
|
||||
const CURRENT_VERSION = "1.0.34";
|
||||
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=
|
||||
@@ -206,6 +206,14 @@ class TimerToggle extends SingletonAction<TimerSettings> {
|
||||
if (activeEntryId) {
|
||||
await Promise.all([ev.action.setState(0), ev.action.setTitle(title)]);
|
||||
} else {
|
||||
// Turn off any other running button immediately using the cache — no async needed
|
||||
for (const other of this.actions) {
|
||||
if (other.id === ev.action.id) continue;
|
||||
const otherSettings = this.settingsCache.get(other.id);
|
||||
if (otherSettings?.activeEntryId) {
|
||||
await Promise.all([other.setState(0), other.setTitle(buttonTitle(otherSettings.projectName || ""))]);
|
||||
}
|
||||
}
|
||||
await Promise.all([ev.action.setState(1), ev.action.setTitle(`⏱ ${title}`)]);
|
||||
}
|
||||
}
|
||||
@@ -233,15 +241,8 @@ class TimerToggle extends SingletonAction<TimerSettings> {
|
||||
} else {
|
||||
const prevEntryId = await getRunningEntryId();
|
||||
|
||||
// Turn off the previously running button immediately
|
||||
// Stop previous timer and update its settings
|
||||
if (prevEntryId) {
|
||||
for (const other of this.actions) {
|
||||
if (other.id === ev.action.id) continue;
|
||||
const otherSettings = this.settingsCache.get(other.id);
|
||||
if (otherSettings?.activeEntryId === prevEntryId) {
|
||||
await Promise.all([other.setState(0), other.setTitle(buttonTitle(otherSettings.projectName || ""))]);
|
||||
}
|
||||
}
|
||||
await stopTimer(global.notionToken, prevEntryId);
|
||||
for (const other of this.actions) {
|
||||
if (other.id === ev.action.id) continue;
|
||||
|
||||
@@ -1 +1 @@
|
||||
{ "version": "1.0.33" }
|
||||
{ "version": "1.0.34" }
|
||||
|
||||
Reference in New Issue
Block a user