fix(update): use semver check to prevent update icon on dev/newer versions

This commit is contained in:
2026-02-16 23:19:41 +01:00
parent 13a0ae3a93
commit 441198dd8d
7 changed files with 50 additions and 13 deletions

View File

@@ -1431,7 +1431,22 @@
console.log(`[Kantine] Version Check: Local [${currentVersion}] vs Remote [${remoteVersion}]`);
if (!remoteVersion || remoteVersion === currentVersion) return;
// Check if remote is NEWER (simple semver check)
const isNewer = (remote, local) => {
if (!remote || !local) return false;
const r = remote.replace(/^v/, '').split('.').map(Number);
const l = local.replace(/^v/, '').split('.').map(Number);
for (let i = 0; i < Math.max(r.length, l.length); i++) {
if ((r[i] || 0) > (l[i] || 0)) return true;
if ((r[i] || 0) < (l[i] || 0)) return false;
}
return false;
};
if (!isNewer(remoteVersion, currentVersion)) {
console.log('[Kantine] No update needed (Remote is not newer).');
return;
}
console.log(`[Kantine] Update verfügbar: ${remoteVersion}`);