chore: always return local version if update check fails (#485)

This commit is contained in:
Aveline
2025-05-20 14:57:57 +02:00
committed by GitHub
parent 66fbda864a
commit 860327bfcd
4 changed files with 51 additions and 35 deletions

View File

@@ -703,12 +703,17 @@ export default function KvmIdRoute() {
send("getUpdateStatus", {}, async resp => {
if ("error" in resp) {
notifications.error("Failed to get device version");
} else {
const result = resp.result as SystemVersionInfo;
setAppVersion(result.local.appVersion);
setSystemVersion(result.local.systemVersion);
notifications.error(`Failed to get device version: ${resp.error}`);
return
}
const result = resp.result as SystemVersionInfo;
if (result.error) {
notifications.error(`Failed to get device version: ${result.error}`);
}
setAppVersion(result.local.appVersion);
setSystemVersion(result.local.systemVersion);
});
}, [appVersion, send, setAppVersion, setSystemVersion]);