Compare commits

...

2 Commits

Author SHA1 Message Date
9e921980ed Thanks coderabbit, you broke my code! 2025-06-18 22:19:21 +08:00
17778b6e2e
Update components/checkAppVersion.ts
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-06-18 21:37:21 +08:00

View File

@ -2,9 +2,11 @@ import currentVersion from "~/versionTag";
export default async function newestVersion() {
const current = currentVersion();
const req = await fetch("/api/version");
const res = await req.json();
if (current !== res.version) {
return false;
if (!req.ok) {
console.error("Version check failed:", req.statusText);
return true; // fail-closed → pretend we are up-to-date
}
return true;
const { version: latest } = await req.json();
return current === latest; // `true` ➜ up-to-date
}