Compare commits

...

8 Commits

Author SHA1 Message Date
pdmarf
52216495c2 Deploy stable-rebuild v1.0.26 plugin.js to master
Staff on v1.0.25 check master's version.json for updates. Previously
master was on 1.0.22 (< 1.0.25) so the updater always said "already
up to date". Now master serves the stable-rebuild v1.0.26 binary so
staff can self-update via Check for Updates.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 07:50:44 +01:00
pdmarf
c06240f03b v1.0.22: refresh projects/users when API token is saved
Previously onPropertyInspectorDidAppear fired once on PI open — if the
token wasn't saved yet (first-time setup), the dropdown stayed empty
forever. Now saving credentials sends a refresh event to the plugin,
which re-fetches and repopulates projects and names immediately.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 20:49:33 +01:00
pdmarf
ad776c9aa9 v1.0.21: auto-updater removes legacy SVG icons on update
Staff machines still had idle.svg/running.svg in their installed plugin
folder (Stream Deck merges rather than replaces on reinstall), causing
the old SVGs to shadow the new PNG icons added in v1.0.15. The
auto-updater now explicitly deletes these legacy files when applying an
update.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 20:43:24 +01:00
pdmarf
3df4468605 v1.0.20: fix button icons and surface user-fetch errors
- Remove stale idle.svg/running.svg from zip (were shadowing the PNG
  icons added in v1.0.15, causing old grey icons to show instead of
  the Aurora timer images)
- Fix package script to always delete and recreate zip so removed files
  don't persist across builds
- Show a clear error in the name dropdown when fetchUsers fails (e.g.
  Notion integration missing "Read user information" capability)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 20:39:51 +01:00
pdmarf
3632300d08 v1.0.19: auto-updater now replaces UI and image assets
Previously only plugin.js was replaced on auto-update, leaving
property-inspector.html, idle.png, and running.png at the originally
installed version. Staff would see the old button colours and missing
UI elements (username dropdown, Update button) even after the code
updated successfully.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 20:02:14 +01:00
pdmarf
8d63a6c7c4 v1.0.18
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 18:35:50 +01:00
pdmarf
e34394c1b4 v1.0.17: reload PI after manual update to show new version
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 18:34:29 +01:00
pdmarf
4cfe58cde3 v1.0.16: manual update button in property inspector
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 18:32:11 +01:00
7 changed files with 167 additions and 47 deletions

View File

@@ -6438,8 +6438,8 @@ async function stopTimer(token, entryId) {
} }
// src/plugin.ts // src/plugin.ts
var CURRENT_VERSION = "1.0.15"; var CURRENT_VERSION = "1.0.26";
var GITEA_BASE = "https://gitea.pdmarf.co.uk/pdm/stream_deck_notion_timer/raw/branch/master"; 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=
-----END PUBLIC KEY-----`; -----END PUBLIC KEY-----`;
@@ -6456,24 +6456,35 @@ function fetchWithTimeout2(url) {
const timer = setTimeout(() => controller.abort(), 1e4); const timer = setTimeout(() => controller.abort(), 1e4);
return fetch(url, { signal: controller.signal }).finally(() => clearTimeout(timer)); return fetch(url, { signal: controller.signal }).finally(() => clearTimeout(timer));
} }
async function checkForUpdates() { async function checkForUpdates(sendStatus) {
try { try {
const resp = await fetchWithTimeout2(`${GITEA_BASE}/version.json`); const resp = await fetchWithTimeout2(`${GITEA_BASE}/version.json`);
if (!resp.ok) return; if (!resp.ok) {
sendStatus?.("Update check failed");
return;
}
const { version } = await resp.json(); const { version } = await resp.json();
if (!/^\d+\.\d+\.\d+$/.test(version)) return; if (!/^\d+\.\d+\.\d+$/.test(version)) return;
if (!isNewerVersion(version, CURRENT_VERSION)) return; if (!isNewerVersion(version, CURRENT_VERSION)) {
sendStatus?.(`Already up to date (v${CURRENT_VERSION})`);
return;
}
sendStatus?.(`Updating to v${version}\u2026`);
const [pluginResp, sigResp] = await Promise.all([ const [pluginResp, sigResp] = await Promise.all([
fetchWithTimeout2(`${GITEA_BASE}/com.pdma.notion-timer.sdPlugin/bin/plugin.js`), fetchWithTimeout2(`${GITEA_BASE}/com.pdma.notion-timer.sdPlugin/bin/plugin.js`),
fetchWithTimeout2(`${GITEA_BASE}/com.pdma.notion-timer.sdPlugin/bin/plugin.js.sig`) fetchWithTimeout2(`${GITEA_BASE}/com.pdma.notion-timer.sdPlugin/bin/plugin.js.sig`)
]); ]);
if (!pluginResp.ok || !sigResp.ok) return; if (!pluginResp.ok || !sigResp.ok) {
sendStatus?.("Download failed");
return;
}
const newCode = await pluginResp.text(); const newCode = await pluginResp.text();
const sigBytes = Buffer.from(await sigResp.arrayBuffer()); const sigBytes = Buffer.from(await sigResp.arrayBuffer());
const { verify } = await import("node:crypto"); const { verify } = await import("node:crypto");
const valid = verify(null, Buffer.from(newCode), SIGNING_PUBLIC_KEY, sigBytes); const valid = verify(null, Buffer.from(newCode), SIGNING_PUBLIC_KEY, sigBytes);
if (!valid) { if (!valid) {
plugin_default.logger.error("Update rejected: signature verification failed"); plugin_default.logger.error("Update rejected: signature verification failed");
sendStatus?.("Update rejected: invalid signature");
return; return;
} }
const fs3 = await import("fs"); const fs3 = await import("fs");
@@ -6481,7 +6492,9 @@ async function checkForUpdates() {
plugin_default.logger.info(`Updated to ${version}, restarting\u2026`); plugin_default.logger.info(`Updated to ${version}, restarting\u2026`);
process.exit(0); process.exit(0);
} catch (err) { } catch (err) {
plugin_default.logger.error(`Update check failed: ${err instanceof Error ? err.message : String(err)}`); const msg = err instanceof Error ? err.message : String(err);
plugin_default.logger.error(`Update check failed: ${msg}`);
sendStatus?.(`Error: ${msg}`);
} }
} }
var HARDCODED = { var HARDCODED = {
@@ -6576,6 +6589,16 @@ var TimerToggle = class extends SingletonAction {
await setRunningEntry(null); await setRunningEntry(null);
} else { } else {
const prevEntryId = await getRunningEntryId(); 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 Promise.all([ev.action.setState(1), ev.action.setTitle(`\u23F1 ${title}`)]);
if (prevEntryId) { if (prevEntryId) {
await stopTimer(global.notionToken, prevEntryId); await stopTimer(global.notionToken, prevEntryId);
for (const other of this.actions) { for (const other of this.actions) {
@@ -6585,8 +6608,6 @@ var TimerToggle = class extends SingletonAction {
const stopped = { ...otherSettings, activeEntryId: null }; const stopped = { ...otherSettings, activeEntryId: null };
await other.setSettings(stopped); await other.setSettings(stopped);
this.settingsCache.set(other.id, stopped); this.settingsCache.set(other.id, stopped);
await other.setState(0);
await other.setTitle(buttonTitle(otherSettings.projectName || ""));
} }
} }
} }
@@ -6601,8 +6622,6 @@ var TimerToggle = class extends SingletonAction {
await ev.action.setSettings(started); await ev.action.setSettings(started);
this.settingsCache.set(ev.action.id, started); this.settingsCache.set(ev.action.id, started);
await setRunningEntry(entryId); await setRunningEntry(entryId);
await ev.action.setState(1);
await ev.action.setTitle(`\u23F1 ${title}`);
} }
} catch (err) { } catch (err) {
plugin_default.logger.error("Timer toggle failed:", err); plugin_default.logger.error("Timer toggle failed:", err);
@@ -6621,6 +6640,11 @@ plugin_default.ui.onSendToPlugin(async (ev) => {
const title = buttonTitle(ev.payload.settings.projectName || ""); const title = buttonTitle(ev.payload.settings.projectName || "");
if (title) await ev.action.setTitle(title); if (title) await ev.action.setTitle(title);
} }
if (ev.payload.event === "checkForUpdates") {
const send = (msg) => plugin_default.ui.sendToPropertyInspector({ event: "updateStatus", message: msg });
send("Checking\u2026");
await checkForUpdates(send);
}
}); });
plugin_default.connect(); plugin_default.connect();
setTimeout(() => checkForUpdates(), 1e4); setTimeout(() => checkForUpdates(), 1e4);

View File

@@ -88,6 +88,26 @@
} }
#credStatus.ok { color: #4caf50; } #credStatus.ok { color: #4caf50; }
#credStatus.error { color: #e57373; } #credStatus.error { color: #e57373; }
#updateBtn {
display: block;
width: 100%;
margin-top: 10px;
padding: 6px;
background: #2a2a2a;
border: 1px solid #444;
border-radius: 4px;
color: #ccc;
font-size: 12px;
cursor: pointer;
}
#updateBtn:hover { background: #333; }
#updateStatus {
font-size: 11px;
color: #888;
text-align: center;
margin-top: 4px;
min-height: 14px;
}
</style> </style>
</head> </head>
<body> <body>
@@ -107,6 +127,7 @@
<option value="">— Select your name —</option> <option value="">— Select your name —</option>
</select> </select>
</div> </div>
<p id="userError" class="hint" style="color:#e57373;padding-left:0;"></p>
<p class="hint">Shared across all buttons. Select once per device.</p> <p class="hint">Shared across all buttons. Select once per device.</p>
<p id="credStatus"></p> <p id="credStatus"></p>
<hr class="divider"> <hr class="divider">
@@ -125,6 +146,8 @@
<p id="statusText"></p> <p id="statusText"></p>
<p id="versionText"></p> <p id="versionText"></p>
<button id="updateBtn">Check for Updates</button>
<p id="updateStatus"></p>
<script src="libs/constants.js"></script> <script src="libs/constants.js"></script>
<script src="libs/prototypes.js"></script> <script src="libs/prototypes.js"></script>
@@ -172,6 +195,9 @@
}; };
$PI.setGlobalSettings(creds); $PI.setGlobalSettings(creds);
setCredStatus("Credentials saved.", "ok"); setCredStatus("Credentials saved.", "ok");
if (creds.notionToken) {
$PI.sendToPlugin({ event: "refresh", notionToken: creds.notionToken });
}
} }
function populateUsers(users, savedUserId) { function populateUsers(users, savedUserId) {
@@ -229,6 +255,10 @@
document.getElementById("projectSelect").addEventListener("change", save); document.getElementById("projectSelect").addEventListener("change", save);
document.getElementById("notionToken").addEventListener("input", scheduleCredSave); document.getElementById("notionToken").addEventListener("input", scheduleCredSave);
document.getElementById("userId").addEventListener("change", saveCredentials); document.getElementById("userId").addEventListener("change", saveCredentials);
document.getElementById("updateBtn").addEventListener("click", function() {
document.getElementById("updateStatus").textContent = "";
$PI.sendToPlugin({ event: "checkForUpdates" });
});
}); });
$PI.onDidReceiveGlobalSettings(function(jsn) { $PI.onDidReceiveGlobalSettings(function(jsn) {
@@ -268,13 +298,27 @@
$PI.onSendToPropertyInspector(ACTION_UUID, function(jsn) { $PI.onSendToPropertyInspector(ACTION_UUID, function(jsn) {
var payload = jsn.payload; var payload = jsn.payload;
if (payload.event === "updateStatus") {
document.getElementById("updateStatus").textContent = payload.message;
if (payload.message && payload.message.indexOf("Updating") === 0) {
setTimeout(function() { location.reload(); }, 4000);
}
}
if (payload.event === "projects") { if (payload.event === "projects") {
if (payload.version) { if (payload.version) {
document.getElementById("versionText").textContent = "v" + payload.version; document.getElementById("versionText").textContent = "v" + payload.version;
} }
if (payload.users) { if (payload.users !== undefined) {
var savedUserId = document.getElementById("userId").value; var savedUserId = document.getElementById("userId").value;
populateUsers(payload.users, savedUserId); populateUsers(payload.users, savedUserId);
var userErr = document.getElementById("userError");
if (payload.usersError) {
userErr.textContent = "Could not load names: " + payload.usersError;
} else if (payload.users.length === 0) {
userErr.textContent = "No users found — check the integration has \u201cRead user information\u201d enabled.";
} else {
userErr.textContent = "";
}
} }
if (payload.error) { if (payload.error) {
setStatus(payload.error, "error"); setStatus(payload.error, "error");

Binary file not shown.

View File

@@ -4,7 +4,7 @@
"description": "Notion time tracking toggle for Stream Deck", "description": "Notion time tracking toggle for Stream Deck",
"scripts": { "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", "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", "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", "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\"", "link": "ln -sf \"$(pwd)/com.pdma.notion-timer.sdPlugin\" \"$HOME/Library/Application Support/com.elgato.StreamDeck/Plugins/com.pdma.notion-timer.sdPlugin\"",

View File

@@ -1,4 +1,4 @@
const CURRENT_VERSION = "1.0.15"; const CURRENT_VERSION = "1.0.22";
const GITEA_BASE = "https://gitea.pdmarf.co.uk/pdm/stream_deck_notion_timer/raw/branch/master"; const GITEA_BASE = "https://gitea.pdmarf.co.uk/pdm/stream_deck_notion_timer/raw/branch/master";
const SIGNING_PUBLIC_KEY = `-----BEGIN PUBLIC KEY----- const SIGNING_PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----
MCowBQYDK2VwAyEAN7ko8TUpuPzPAJuKAZCRjV0c4ZSlou5d9pUAF6o12b4= MCowBQYDK2VwAyEAN7ko8TUpuPzPAJuKAZCRjV0c4ZSlou5d9pUAF6o12b4=
@@ -6,11 +6,15 @@ MCowBQYDK2VwAyEAN7ko8TUpuPzPAJuKAZCRjV0c4ZSlou5d9pUAF6o12b4=
function isNewerVersion(remote: string, current: string): boolean { function isNewerVersion(remote: string, current: string): boolean {
const parse = (v: string) => v.split(".").map(Number); const parse = (v: string) => v.split(".").map(Number);
const [rMaj, rMin, rPat] = parse(remote); const r = parse(remote);
const [cMaj, cMin, cPat] = parse(current); const c = parse(current);
if (rMaj !== cMaj) return rMaj > cMaj; const len = Math.max(r.length, c.length);
if (rMin !== cMin) return rMin > cMin; for (let i = 0; i < len; i++) {
return rPat > cPat; const rv = r[i] ?? 0;
const cv = c[i] ?? 0;
if (rv !== cv) return rv > cv;
}
return false;
} }
function fetchWithTimeout(url: string): Promise<Response> { function fetchWithTimeout(url: string): Promise<Response> {
@@ -19,19 +23,24 @@ function fetchWithTimeout(url: string): Promise<Response> {
return fetch(url, { signal: controller.signal }).finally(() => clearTimeout(timer)); return fetch(url, { signal: controller.signal }).finally(() => clearTimeout(timer));
} }
async function checkForUpdates(): Promise<void> { async function checkForUpdates(sendStatus?: (msg: string) => void): Promise<void> {
try { try {
const resp = await fetchWithTimeout(`${GITEA_BASE}/version.json`); const resp = await fetchWithTimeout(`${GITEA_BASE}/version.json`);
if (!resp.ok) return; if (!resp.ok) { sendStatus?.("Update check failed"); return; }
const { version } = await resp.json() as { version: string }; const { version } = await resp.json() as { version: string };
if (!/^\d+\.\d+\.\d+$/.test(version)) return; if (!/^\d+(\.\d+)+$/.test(version)) return;
if (!isNewerVersion(version, CURRENT_VERSION)) return; if (!isNewerVersion(version, CURRENT_VERSION)) {
sendStatus?.(`Already up to date (v${CURRENT_VERSION})`);
return;
}
sendStatus?.(`Updating to v${version}`);
const PLUGIN_BASE = `${GITEA_BASE}/com.pdma.notion-timer.sdPlugin`;
const [pluginResp, sigResp] = await Promise.all([ const [pluginResp, sigResp] = await Promise.all([
fetchWithTimeout(`${GITEA_BASE}/com.pdma.notion-timer.sdPlugin/bin/plugin.js`), fetchWithTimeout(`${PLUGIN_BASE}/bin/plugin.js`),
fetchWithTimeout(`${GITEA_BASE}/com.pdma.notion-timer.sdPlugin/bin/plugin.js.sig`), fetchWithTimeout(`${PLUGIN_BASE}/bin/plugin.js.sig`),
]); ]);
if (!pluginResp.ok || !sigResp.ok) return; if (!pluginResp.ok || !sigResp.ok) { sendStatus?.("Download failed"); return; }
const newCode = await pluginResp.text(); const newCode = await pluginResp.text();
const sigBytes = Buffer.from(await sigResp.arrayBuffer()); const sigBytes = Buffer.from(await sigResp.arrayBuffer());
@@ -40,15 +49,43 @@ async function checkForUpdates(): Promise<void> {
const valid = verify(null, Buffer.from(newCode), SIGNING_PUBLIC_KEY, sigBytes); const valid = verify(null, Buffer.from(newCode), SIGNING_PUBLIC_KEY, sigBytes);
if (!valid) { if (!valid) {
streamDeck.logger.error("Update rejected: signature verification failed"); streamDeck.logger.error("Update rejected: signature verification failed");
sendStatus?.("Update rejected: invalid signature");
return; return;
} }
const fs = await import("fs"); const fs = await import("fs");
const path = await import("path");
const pluginRoot = path.join(path.dirname(__filename), "..");
// Also update UI and image assets. These are not separately signed — they run in a browser
// sandbox (not Node), and are fetched over HTTPS from the same trusted server.
const ASSETS = [
"ui/property-inspector.html",
"ui/global-property-inspector.html",
"imgs/idle.png",
"imgs/running.png",
];
const assetResps = await Promise.all(ASSETS.map(p => fetchWithTimeout(`${PLUGIN_BASE}/${p}`)));
fs.writeFileSync(__filename, newCode); fs.writeFileSync(__filename, newCode);
for (let i = 0; i < ASSETS.length; i++) {
if (!assetResps[i].ok) { streamDeck.logger.warn(`Asset download failed: ${ASSETS[i]}`); continue; }
fs.writeFileSync(path.join(pluginRoot, ASSETS[i]), Buffer.from(await assetResps[i].arrayBuffer()));
}
// Remove legacy files that were replaced in older versions but persist on disk
// because Stream Deck merges rather than replaces the plugin folder on reinstall.
const LEGACY = ["imgs/idle.svg", "imgs/running.svg"];
for (const f of LEGACY) {
try { fs.unlinkSync(path.join(pluginRoot, f)); } catch { /* already gone */ }
}
streamDeck.logger.info(`Updated to ${version}, restarting…`); streamDeck.logger.info(`Updated to ${version}, restarting…`);
process.exit(0); process.exit(0);
} catch (err) { } catch (err) {
streamDeck.logger.error(`Update check failed: ${err instanceof Error ? err.message : String(err)}`); const msg = err instanceof Error ? err.message : String(err);
streamDeck.logger.error(`Update check failed: ${msg}`);
sendStatus?.(`Error: ${msg}`);
} }
} }
@@ -102,6 +139,30 @@ async function setRunningEntry(entryId: string | null): Promise<void> {
await streamDeck.settings.setGlobalSettings({ ...stored, runningEntryId: entryId }); await streamDeck.settings.setGlobalSettings({ ...stored, runningEntryId: entryId });
} }
async function sendProjectsToPI(overrideToken?: string): Promise<void> {
try {
const global = await getGlobal();
const token = overrideToken || global.notionToken;
if (!token) {
await streamDeck.ui.sendToPropertyInspector({ event: "projects", data: [], error: "Enter your Notion API token above.", version: CURRENT_VERSION });
return;
}
let usersResult: Awaited<ReturnType<typeof fetchUsers>> = [];
let usersError: string | undefined;
const [projects] = await Promise.all([
fetchProjects(token, global.projectsDbId),
fetchUsers(token).then((u) => { usersResult = u; }).catch((err) => {
streamDeck.logger.error("Failed to fetch users:", err);
usersError = err instanceof Error ? err.message : String(err);
}),
]);
await streamDeck.ui.sendToPropertyInspector({ event: "projects", data: projects, users: usersResult, usersError, version: CURRENT_VERSION });
} catch (err) {
streamDeck.logger.error("Failed to fetch projects:", err);
await streamDeck.ui.sendToPropertyInspector({ event: "projects", data: [], error: String(err), version: CURRENT_VERSION });
}
}
function isConfigured(g: GlobalSettings): boolean { function isConfigured(g: GlobalSettings): boolean {
return !!(g.notionToken && g.userId); return !!(g.notionToken && g.userId);
} }
@@ -139,25 +200,8 @@ class TimerToggle extends SingletonAction<TimerSettings> {
} }
} }
async onPropertyInspectorDidAppear(ev: PropertyInspectorDidAppearEvent<TimerSettings>): Promise<void> { async onPropertyInspectorDidAppear(_ev: PropertyInspectorDidAppearEvent<TimerSettings>): Promise<void> {
try { await sendProjectsToPI();
const global = await getGlobal();
if (!global.notionToken) {
await streamDeck.ui.sendToPropertyInspector({ event: "projects", data: [], error: "Enter your Notion API token above.", version: CURRENT_VERSION });
return;
}
const [projects, usersResult] = await Promise.all([
fetchProjects(global.notionToken, global.projectsDbId),
fetchUsers(global.notionToken).catch((err) => {
streamDeck.logger.error("Failed to fetch users:", err);
return [];
}),
]);
await streamDeck.ui.sendToPropertyInspector({ event: "projects", data: projects, users: usersResult, version: CURRENT_VERSION });
} catch (err) {
streamDeck.logger.error("Failed to fetch projects:", err);
await streamDeck.ui.sendToPropertyInspector({ event: "projects", data: [], error: String(err), version: CURRENT_VERSION });
}
} }
async onKeyDown(ev: KeyDownEvent<TimerSettings>): Promise<void> { async onKeyDown(ev: KeyDownEvent<TimerSettings>): Promise<void> {
@@ -235,6 +279,14 @@ streamDeck.ui.onSendToPlugin<{ event: string; settings?: TimerSettings }>(async
const title = buttonTitle(ev.payload.settings.projectName || ""); const title = buttonTitle(ev.payload.settings.projectName || "");
if (title) await ev.action.setTitle(title); if (title) await ev.action.setTitle(title);
} }
if (ev.payload.event === "refresh") {
await sendProjectsToPI(ev.payload.notionToken as string | undefined);
}
if (ev.payload.event === "checkForUpdates") {
const send = (msg: string) => streamDeck.ui.sendToPropertyInspector({ event: "updateStatus", message: msg });
send("Checking…");
await checkForUpdates(send);
}
}); });
streamDeck.connect(); streamDeck.connect();

View File

@@ -1 +1 @@
{ "version": "1.0.15" } { "version": "1.0.26" }