tauri: return after update failures

thinking-toggle-wip
Brendan Allan 2025-12-17 22:52:03 +08:00 committed by Aiden Cline
parent 5524c9c6dc
commit f4e851d9a1
1 changed files with 3 additions and 1 deletions

View File

@ -11,12 +11,12 @@ export async function runUpdater({ alertOnFail }: { alertOnFail: boolean }) {
update = await check()
} catch {
if (alertOnFail) await message("Failed to check for updates", { title: "Update Check Failed" })
return
}
if (!update) {
if (alertOnFail)
await message("You are already using the latest version of OpenCode", { title: "No Update Available" })
return
}
@ -24,6 +24,7 @@ export async function runUpdater({ alertOnFail }: { alertOnFail: boolean }) {
await update.download()
} catch {
if (alertOnFail) await message("Failed to download update", { title: "Update Failed" })
return
}
const shouldUpdate = await ask(
@ -36,6 +37,7 @@ export async function runUpdater({ alertOnFail }: { alertOnFail: boolean }) {
await update.install()
} catch {
await message("Failed to install update", { title: "Update Failed" })
return
}
await invoke("kill_sidecar")