Merge branch 'stable-rebuild'
This commit is contained in:
@@ -6438,7 +6438,7 @@ async function stopTimer(token, entryId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// src/plugin.ts
|
// 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 GITEA_BASE = "https://gitea.pdmarf.co.uk/pdm/stream_deck_notion_timer/raw/branch/stable-rebuild";
|
||||||
var SIGNING_PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----
|
var SIGNING_PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----
|
||||||
MCowBQYDK2VwAyEAN7ko8TUpuPzPAJuKAZCRjV0c4ZSlou5d9pUAF6o12b4=
|
MCowBQYDK2VwAyEAN7ko8TUpuPzPAJuKAZCRjV0c4ZSlou5d9pUAF6o12b4=
|
||||||
@@ -6599,6 +6599,13 @@ var TimerToggle = class extends SingletonAction {
|
|||||||
if (activeEntryId) {
|
if (activeEntryId) {
|
||||||
await Promise.all([ev.action.setState(0), ev.action.setTitle(title)]);
|
await Promise.all([ev.action.setState(0), ev.action.setTitle(title)]);
|
||||||
} else {
|
} 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}`)]);
|
await Promise.all([ev.action.setState(1), ev.action.setTitle(`\u23F1 ${title}`)]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6622,13 +6629,6 @@ var TimerToggle = class extends SingletonAction {
|
|||||||
} else {
|
} else {
|
||||||
const prevEntryId = await getRunningEntryId();
|
const prevEntryId = await getRunningEntryId();
|
||||||
if (prevEntryId) {
|
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);
|
await stopTimer(global.notionToken, prevEntryId);
|
||||||
for (const other of this.actions) {
|
for (const other of this.actions) {
|
||||||
if (other.id === ev.action.id) continue;
|
if (other.id === ev.action.id) continue;
|
||||||
|
|||||||
Binary file not shown.
@@ -2,7 +2,7 @@
|
|||||||
"Author": "Pete Marfleet",
|
"Author": "Pete Marfleet",
|
||||||
"Description": "Toggle Notion time tracking for a project with a single button press.",
|
"Description": "Toggle Notion time tracking for a project with a single button press.",
|
||||||
"Name": "Notion Timer",
|
"Name": "Notion Timer",
|
||||||
"Version": "1.0.33",
|
"Version": "1.0.34",
|
||||||
"SDKVersion": 2,
|
"SDKVersion": 2,
|
||||||
"Software": { "MinimumVersion": "5.0" },
|
"Software": { "MinimumVersion": "5.0" },
|
||||||
"OS": [{ "Platform": "mac", "MinimumVersion": "10.11" }],
|
"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 GITEA_BASE = "https://gitea.pdmarf.co.uk/pdm/stream_deck_notion_timer/raw/branch/stable-rebuild";
|
||||||
const SIGNING_PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----
|
const SIGNING_PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----
|
||||||
MCowBQYDK2VwAyEAN7ko8TUpuPzPAJuKAZCRjV0c4ZSlou5d9pUAF6o12b4=
|
MCowBQYDK2VwAyEAN7ko8TUpuPzPAJuKAZCRjV0c4ZSlou5d9pUAF6o12b4=
|
||||||
@@ -206,6 +206,14 @@ class TimerToggle extends SingletonAction<TimerSettings> {
|
|||||||
if (activeEntryId) {
|
if (activeEntryId) {
|
||||||
await Promise.all([ev.action.setState(0), ev.action.setTitle(title)]);
|
await Promise.all([ev.action.setState(0), ev.action.setTitle(title)]);
|
||||||
} else {
|
} 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}`)]);
|
await Promise.all([ev.action.setState(1), ev.action.setTitle(`⏱ ${title}`)]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -233,15 +241,8 @@ class TimerToggle extends SingletonAction<TimerSettings> {
|
|||||||
} else {
|
} else {
|
||||||
const prevEntryId = await getRunningEntryId();
|
const prevEntryId = await getRunningEntryId();
|
||||||
|
|
||||||
// Turn off the previously running button immediately
|
// Stop previous timer and update its settings
|
||||||
if (prevEntryId) {
|
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);
|
await stopTimer(global.notionToken, prevEntryId);
|
||||||
for (const other of this.actions) {
|
for (const other of this.actions) {
|
||||||
if (other.id === ev.action.id) continue;
|
if (other.id === ev.action.id) continue;
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{ "version": "1.0.33" }
|
{ "version": "1.0.34" }
|
||||||
|
|||||||
Reference in New Issue
Block a user