feat(update): add API endpoint to retrieve app version and update client-side calls
This commit is contained in:
1 parent
3acd9280ac
commit
24537093ad
6 files changed
+23
-10
No files matched your search
@@ -109,6 +109,7 @@ export const deleteHistoryEntry = forward("deleteHistoryEntry");
|
||||
|
||||
// Updates
|
||||
export const checkForUpdates = forward("checkForUpdates");
|
||||
export const getAppVersion = forward("getAppVersion");
|
||||
|
||||
// Layout
|
||||
export const saveSidebarLayout = forward("saveSidebarLayout");
|
||||
|
||||
@@ -543,6 +543,11 @@ export async function checkForUpdates(): Promise<UpdateInfo> {
|
||||
return get("/api/update/check");
|
||||
}
|
||||
|
||||
export async function getAppVersion(): Promise<string> {
|
||||
const res: { version: string } = await get("/api/version");
|
||||
return res.version;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Layout
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
@@ -230,6 +230,11 @@ export async function checkForUpdates(): Promise<UpdateInfo> {
|
||||
return invoke("check_for_updates");
|
||||
}
|
||||
|
||||
export async function getAppVersion(): Promise<string> {
|
||||
const { getVersion } = await import("@tauri-apps/api/app");
|
||||
return getVersion();
|
||||
}
|
||||
|
||||
// --- Redis ---
|
||||
export interface RedisKeyInfo {
|
||||
key: string;
|
||||
|
||||
Reference in new issue
Block a user