mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-23 13:04:23 +00:00
Some checks failed
Build and Push Beta Image / build-and-push (push) Has been cancelled
12 lines
419 B
TypeScript
12 lines
419 B
TypeScript
import currentVersion from "~/versionTag";
|
|
export default async function newestVersion() {
|
|
const current = currentVersion();
|
|
const req = await fetch("/api/version");
|
|
if (!req.ok) {
|
|
console.error("Version check failed:", req.statusText);
|
|
return true; // fail-closed → pretend we are up-to-date
|
|
}
|
|
|
|
const { version: latest } = await req.json();
|
|
return current === latest; // `true` ➜ up-to-date
|
|
}
|