-
+ {applying && (
+
+
+ {msg || "Update läuft..."}
+
+ )}
- {msg && {msg}
}
+ {msg && !applying && {msg}
}
{status.last_check && Letzte Prüfung: {new Date(status.last_check).toLocaleString("de-DE")}
}
diff --git a/components/UpdateBanner.tsx b/components/UpdateBanner.tsx
index 491ed57..17fe1cd 100644
--- a/components/UpdateBanner.tsx
+++ b/components/UpdateBanner.tsx
@@ -15,10 +15,16 @@ export function UpdateBanner() {
const [dismissed, setDismissed] = useState(false);
useEffect(() => {
- fetch("/api/update/check")
- .then((r) => r.json())
- .then(setInfo)
- .catch(() => {});
+ let cancelled = false;
+ function load() {
+ fetch("/api/update/check", { cache: "no-store" })
+ .then((r) => r.json())
+ .then((d) => { if (!cancelled) setInfo(d); })
+ .catch(() => {});
+ }
+ load();
+ const id = setInterval(load, 60_000);
+ return () => { cancelled = true; clearInterval(id); };
}, []);
if (!info?.update_available || dismissed) return null;
diff --git a/lib/updater.ts b/lib/updater.ts
index aded5d6..07e152c 100644
--- a/lib/updater.ts
+++ b/lib/updater.ts
@@ -83,10 +83,13 @@ export async function checkForUpdate(): Promise