@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user