Compare commits
21 Commits
master
...
1294688b40
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1294688b40 | ||
|
|
9b62d55dbe | ||
|
|
0eeeed270f | ||
|
|
49e939c137 | ||
|
|
7e66939fdb | ||
|
|
ea15f72215 | ||
|
|
e493c19cc8 | ||
|
|
51c83f572e | ||
|
|
a21e849ea3 | ||
|
|
617c8773de | ||
|
|
2eb4c8f53a | ||
|
|
53c0ae7993 | ||
|
|
d9ca28d125 | ||
|
|
52216495c2 | ||
|
|
c06240f03b | ||
|
|
ad776c9aa9 | ||
|
|
3df4468605 | ||
|
|
3632300d08 | ||
|
|
8d63a6c7c4 | ||
|
|
e34394c1b4 | ||
|
|
4cfe58cde3 |
@@ -6438,7 +6438,7 @@ async function stopTimer(token, entryId) {
|
||||
}
|
||||
|
||||
// src/plugin.ts
|
||||
var CURRENT_VERSION = "1.0.39";
|
||||
var CURRENT_VERSION = "1.0.38";
|
||||
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=
|
||||
@@ -6535,10 +6535,11 @@ async function loadRunningState() {
|
||||
memRunningEntryId = stored.runningEntryId ?? null;
|
||||
memRunningActionId = stored.runningActionId ?? null;
|
||||
}
|
||||
function setRunningEntry(entryId, actionId) {
|
||||
async function setRunningEntry(entryId, actionId) {
|
||||
memRunningEntryId = entryId;
|
||||
memRunningActionId = actionId;
|
||||
plugin_default.settings.getGlobalSettings().then((stored) => plugin_default.settings.setGlobalSettings({ ...stored, runningEntryId: entryId, runningActionId: actionId })).catch((err) => plugin_default.logger.error("Failed to persist running state:", err));
|
||||
const stored = await plugin_default.settings.getGlobalSettings();
|
||||
await plugin_default.settings.setGlobalSettings({ ...stored, runningEntryId: entryId, runningActionId: actionId });
|
||||
}
|
||||
async function sendProjectsToPI(tokenOverride) {
|
||||
try {
|
||||
@@ -6613,15 +6614,13 @@ var TimerToggle = class extends SingletonAction {
|
||||
try {
|
||||
if (isRunning) {
|
||||
await stopTimer(global.notionToken, memRunningEntryId);
|
||||
setRunningEntry(null, null);
|
||||
await Promise.all([ev.action.setState(0), ev.action.setTitle(title)]);
|
||||
await setRunningEntry(null, null);
|
||||
} else {
|
||||
if (memRunningEntryId) {
|
||||
await stopTimer(global.notionToken, memRunningEntryId);
|
||||
}
|
||||
const entryId = await startTimer(global.notionToken, global.timingDbId, projectId, projectName, global.userId);
|
||||
setRunningEntry(entryId, ev.action.id);
|
||||
await Promise.all([ev.action.setState(1), ev.action.setTitle(`\u23F1 ${title}`)]);
|
||||
await setRunningEntry(entryId, ev.action.id);
|
||||
}
|
||||
} catch (err) {
|
||||
await Promise.all([
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
в<╥!Ъ░xR√з└СRё;=▀LI"я╓╢HuэF├ы▐Ос─╒┘ sb▌Y╛{йH│╤Н.JщNЦь1╔l
|
||||
Κ¤<06>C¤•Sί¤
|
||||
Φ®Έ}•~P}ηΜ<>Z;·ΆxΤη{,¦NYPπu4#ΑΚ„jα§ΎWCκΈ©σΔ«Έ<0E>d
|
||||
@@ -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.39",
|
||||
"Version": "1.0.38",
|
||||
"SDKVersion": 2,
|
||||
"Software": { "MinimumVersion": "5.0" },
|
||||
"OS": [{ "Platform": "mac", "MinimumVersion": "10.11" }],
|
||||
|
||||
@@ -7,7 +7,7 @@ TMP_DIR=$(mktemp -d)
|
||||
PLUGIN_FILE="${TMP_DIR}/notion-timer.streamDeckPlugin"
|
||||
|
||||
echo "Downloading Notion Timer..."
|
||||
curl -sL "${GITEA}/${REPO}/raw/branch/stable-rebuild/notion-timer.streamDeckPlugin" -o "${PLUGIN_FILE}"
|
||||
curl -sL "${GITEA}/${REPO}/raw/branch/master/notion-timer.streamDeckPlugin" -o "${PLUGIN_FILE}"
|
||||
|
||||
echo "Installing — Stream Deck will open automatically..."
|
||||
open "${PLUGIN_FILE}"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"description": "Notion time tracking toggle for Stream Deck",
|
||||
"scripts": {
|
||||
"build": "esbuild src/plugin.ts --bundle --platform=node --target=node20 --outfile=com.pdma.notion-timer.sdPlugin/bin/plugin.js --external:electron && node scripts/sign.js",
|
||||
"package": "npm run build && zip -r notion-timer.streamDeckPlugin com.pdma.notion-timer.sdPlugin && echo 'Packaged: notion-timer.streamDeckPlugin'",
|
||||
"package": "npm run build && rm -f notion-timer.streamDeckPlugin && zip -r notion-timer.streamDeckPlugin com.pdma.notion-timer.sdPlugin && echo 'Packaged: notion-timer.streamDeckPlugin'",
|
||||
"dev": "esbuild src/plugin.ts --bundle --platform=node --target=node20 --outfile=com.pdma.notion-timer.sdPlugin/bin/plugin.js --external:electron --watch",
|
||||
"sign": "node scripts/sign.js",
|
||||
"link": "ln -sf \"$(pwd)/com.pdma.notion-timer.sdPlugin\" \"$HOME/Library/Application Support/com.elgato.StreamDeck/Plugins/com.pdma.notion-timer.sdPlugin\"",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const CURRENT_VERSION = "1.0.39";
|
||||
const CURRENT_VERSION = "1.0.38";
|
||||
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=
|
||||
@@ -125,13 +125,11 @@ async function loadRunningState(): Promise<void> {
|
||||
memRunningActionId = stored.runningActionId ?? null;
|
||||
}
|
||||
|
||||
function setRunningEntry(entryId: string | null, actionId: string | null): void {
|
||||
async function setRunningEntry(entryId: string | null, actionId: string | null): Promise<void> {
|
||||
memRunningEntryId = entryId;
|
||||
memRunningActionId = actionId;
|
||||
// Persist in background — do not await, so the visual is never blocked
|
||||
streamDeck.settings.getGlobalSettings<GlobalSettings>()
|
||||
.then(stored => streamDeck.settings.setGlobalSettings({ ...stored, runningEntryId: entryId, runningActionId: actionId }))
|
||||
.catch(err => streamDeck.logger.error("Failed to persist running state:", err));
|
||||
const stored = await streamDeck.settings.getGlobalSettings<GlobalSettings>();
|
||||
await streamDeck.settings.setGlobalSettings({ ...stored, runningEntryId: entryId, runningActionId: actionId });
|
||||
}
|
||||
|
||||
async function sendProjectsToPI(tokenOverride?: string): Promise<void> {
|
||||
@@ -212,15 +210,13 @@ class TimerToggle extends SingletonAction<TimerSettings> {
|
||||
try {
|
||||
if (isRunning) {
|
||||
await stopTimer(global.notionToken, memRunningEntryId!);
|
||||
setRunningEntry(null, null);
|
||||
await Promise.all([ev.action.setState(0), ev.action.setTitle(title)]);
|
||||
await setRunningEntry(null, null);
|
||||
} else {
|
||||
if (memRunningEntryId) {
|
||||
await stopTimer(global.notionToken, memRunningEntryId);
|
||||
}
|
||||
const entryId = await startTimer(global.notionToken, global.timingDbId, projectId, projectName, global.userId);
|
||||
setRunningEntry(entryId, ev.action.id);
|
||||
await Promise.all([ev.action.setState(1), ev.action.setTitle(`⏱ ${title}`)]);
|
||||
await setRunningEntry(entryId, ev.action.id);
|
||||
}
|
||||
} catch (err) {
|
||||
// Revert visual on error
|
||||
|
||||
@@ -1 +1 @@
|
||||
{ "version": "1.0.39" }
|
||||
{ "version": "1.0.38" }
|
||||
|
||||
Reference in New Issue
Block a user