enh: force refresh page on update

This commit is contained in:
Timothy Jaeryang Baek
2025-11-03 13:43:07 -05:00
parent 67aa1b028d
commit 989f192c92
4 changed files with 53 additions and 13 deletions

View File

@@ -1401,6 +1401,33 @@ export const getChangelog = async () => {
return res;
};
export const getVersion = async (token: string) => {
let error = null;
const res = await fetch(`${WEBUI_BASE_URL}/api/version`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${token}`
}
})
.then(async (res) => {
if (!res.ok) throw await res.json();
return res.json();
})
.catch((err) => {
console.error(err);
error = err;
return null;
});
if (error) {
throw error;
}
return res?.version ?? null;
};
export const getVersionUpdates = async (token: string) => {
let error = null;