mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-23 13:04:23 +00:00
Thanks coderabbit, you broke my code!
Some checks failed
Build and Push Beta Image / build-and-push (push) Has been cancelled
Some checks failed
Build and Push Beta Image / build-and-push (push) Has been cancelled
This commit is contained in:
parent
17778b6e2e
commit
9e921980ed
1 changed files with 2 additions and 4 deletions
|
@ -1,14 +1,12 @@
|
||||||
import currentVersion from "~/versionTag";
|
import currentVersion from "~/versionTag";
|
||||||
export default async function newestVersion() {
|
|
||||||
export default async function newestVersion() {
|
export default async function newestVersion() {
|
||||||
const current = currentVersion();
|
const current = currentVersion();
|
||||||
const req = await fetch("/api/version");
|
const req = await fetch("/api/version");
|
||||||
if (!req.ok) {
|
if (!req.ok) {
|
||||||
console.error("Version check failed:", req.statusText);
|
console.error("Version check failed:", req.statusText);
|
||||||
return true; // fail-closed → pretend we are up-to-date
|
return true; // fail-closed → pretend we are up-to-date
|
||||||
}
|
}
|
||||||
|
|
||||||
const { version: latest } = await req.json();
|
const { version: latest } = await req.json();
|
||||||
return current === latest; // `true` ➜ up-to-date
|
return current === latest; // `true` ➜ up-to-date
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue