diff --git a/com.pdma.notion-timer.sdPlugin/bin/plugin.js b/com.pdma.notion-timer.sdPlugin/bin/plugin.js index f151291..2e7db12 100644 --- a/com.pdma.notion-timer.sdPlugin/bin/plugin.js +++ b/com.pdma.notion-timer.sdPlugin/bin/plugin.js @@ -6438,18 +6438,22 @@ async function stopTimer(token, entryId) { } // src/plugin.ts -var CURRENT_VERSION = "1.0.17"; +var CURRENT_VERSION = "1.0.18"; var GITEA_BASE = "https://gitea.pdmarf.co.uk/pdm/stream_deck_notion_timer/raw/branch/master"; var SIGNING_PUBLIC_KEY = `-----BEGIN PUBLIC KEY----- MCowBQYDK2VwAyEAN7ko8TUpuPzPAJuKAZCRjV0c4ZSlou5d9pUAF6o12b4= -----END PUBLIC KEY-----`; function isNewerVersion(remote, current) { const parse = (v) => v.split(".").map(Number); - const [rMaj, rMin, rPat] = parse(remote); - const [cMaj, cMin, cPat] = parse(current); - if (rMaj !== cMaj) return rMaj > cMaj; - if (rMin !== cMin) return rMin > cMin; - return rPat > cPat; + const r = parse(remote); + const c = parse(current); + const len = Math.max(r.length, c.length); + for (let i = 0; i < len; i++) { + const rv = r[i] ?? 0; + const cv = c[i] ?? 0; + if (rv !== cv) return rv > cv; + } + return false; } function fetchWithTimeout2(url) { const controller = new AbortController(); @@ -6464,7 +6468,7 @@ async function checkForUpdates(sendStatus) { return; } const { version } = await resp.json(); - if (!/^\d+\.\d+\.\d+$/.test(version)) return; + if (!/^\d+(\.\d+)+$/.test(version)) return; if (!isNewerVersion(version, CURRENT_VERSION)) { sendStatus?.(`Already up to date (v${CURRENT_VERSION})`); return; diff --git a/com.pdma.notion-timer.sdPlugin/bin/plugin.js.sig b/com.pdma.notion-timer.sdPlugin/bin/plugin.js.sig index 52d3148..df7946a 100644 --- a/com.pdma.notion-timer.sdPlugin/bin/plugin.js.sig +++ b/com.pdma.notion-timer.sdPlugin/bin/plugin.js.sig @@ -1 +1 @@ -ţb3NE(T%,w҉8,vW7UρrW&")K \ No newline at end of file +hj5$r!cdґ]koliH* ; c  \ No newline at end of file diff --git a/notion-timer.streamDeckPlugin b/notion-timer.streamDeckPlugin index 93f3f71..f98c054 100644 Binary files a/notion-timer.streamDeckPlugin and b/notion-timer.streamDeckPlugin differ diff --git a/src/plugin.ts b/src/plugin.ts index c29595f..d109ce6 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -1,4 +1,4 @@ -const CURRENT_VERSION = "1.0.17"; +const CURRENT_VERSION = "1.0.18"; const GITEA_BASE = "https://gitea.pdmarf.co.uk/pdm/stream_deck_notion_timer/raw/branch/master"; const SIGNING_PUBLIC_KEY = `-----BEGIN PUBLIC KEY----- MCowBQYDK2VwAyEAN7ko8TUpuPzPAJuKAZCRjV0c4ZSlou5d9pUAF6o12b4= @@ -6,11 +6,15 @@ MCowBQYDK2VwAyEAN7ko8TUpuPzPAJuKAZCRjV0c4ZSlou5d9pUAF6o12b4= function isNewerVersion(remote: string, current: string): boolean { const parse = (v: string) => v.split(".").map(Number); - const [rMaj, rMin, rPat] = parse(remote); - const [cMaj, cMin, cPat] = parse(current); - if (rMaj !== cMaj) return rMaj > cMaj; - if (rMin !== cMin) return rMin > cMin; - return rPat > cPat; + const r = parse(remote); + const c = parse(current); + const len = Math.max(r.length, c.length); + for (let i = 0; i < len; i++) { + const rv = r[i] ?? 0; + const cv = c[i] ?? 0; + if (rv !== cv) return rv > cv; + } + return false; } function fetchWithTimeout(url: string): Promise { @@ -24,7 +28,7 @@ async function checkForUpdates(sendStatus?: (msg: string) => void): Promise