Browse Source

tauri: return after update failures

Brendan Allan 2 months ago
parent
commit
f8df1d3185
1 changed files with 3 additions and 1 deletions
  1. 3 1
      packages/tauri/src/updater.ts

+ 3 - 1
packages/tauri/src/updater.ts

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