mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-23 13:04:23 +00:00
Add function to fetch the newest version of the app & also a popup.
This commit is contained in:
parent
a000a080ed
commit
804694f74c
2 changed files with 49 additions and 0 deletions
10
components/checkAppVersion.ts
Normal file
10
components/checkAppVersion.ts
Normal file
|
@ -0,0 +1,10 @@
|
|||
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;
|
||||
}
|
||||
return true;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue