fix(update): use semver check to prevent update icon on dev/newer versions
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
## v1.2.9 (2026-02-16)
|
||||
- **Fix**: Update-Benachrichtigung erscheint nur noch, wenn die GitHub-Version wirklich *neuer* ist (SemVer-Check). Kein Icon mehr bei gleichen oder älteren Versionen. ✅
|
||||
|
||||
## v1.2.8 (2026-02-16)
|
||||
- **Debug**: Weiteres Logging (Fetch-Status, Start-Log) zur Fehlersuche. 🔎
|
||||
|
||||
|
||||
2
dist/bookmarklet-payload.js
vendored
2
dist/bookmarklet-payload.js
vendored
File diff suppressed because one or more lines are too long
2
dist/bookmarklet.txt
vendored
2
dist/bookmarklet.txt
vendored
File diff suppressed because one or more lines are too long
16
dist/install.html
vendored
16
dist/install.html
vendored
File diff suppressed because one or more lines are too long
21
dist/kantine-standalone.html
vendored
21
dist/kantine-standalone.html
vendored
@@ -1680,7 +1680,7 @@ body {
|
||||
<div class="brand">
|
||||
<span class="material-icons-round logo-icon">restaurant_menu</span>
|
||||
<div class="header-left">
|
||||
<h1>Kantinen Übersicht <small style="font-size: 0.6em; opacity: 0.7; font-weight: 400;">v1.2.8</small></h1>
|
||||
<h1>Kantinen Übersicht <small style="font-size: 0.6em; opacity: 0.7; font-weight: 400;">v1.2.9</small></h1>
|
||||
<div id="last-updated-subtitle" class="subtitle"></div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -3028,7 +3028,7 @@ body {
|
||||
// === Version Check (periodic, every hour) ===
|
||||
async function checkForUpdates() {
|
||||
console.log('[Kantine] Starting update check...');
|
||||
const currentVersion = 'v1.2.8';
|
||||
const currentVersion = 'v1.2.9';
|
||||
const versionUrl = 'https://raw.githubusercontent.com/TauNeutrino/kantine-overview/main/version.txt';
|
||||
const installerUrl = 'https://htmlpreview.github.io/?https://github.com/TauNeutrino/kantine-overview/blob/main/dist/install.html';
|
||||
|
||||
@@ -3045,7 +3045,22 @@ body {
|
||||
|
||||
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}`);
|
||||
|
||||
|
||||
17
kantine.js
17
kantine.js
@@ -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}`);
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
v1.2.8
|
||||
v1.2.9
|
||||
|
||||
Reference in New Issue
Block a user