chore: generate
This commit is contained in:
parent
9b4d5b0395
commit
7a2c49e762
4 changed files with 8 additions and 18 deletions
|
|
@ -5,11 +5,7 @@ export type { UpdaterState } from "@opencode-ai/app/updater"
|
|||
export type UpdaterReadyRecord = { version: string }
|
||||
|
||||
export type UpdaterBackend = {
|
||||
checkForUpdates(): Promise<
|
||||
| { isUpdateAvailable?: boolean; updateInfo?: { version?: string } }
|
||||
| null
|
||||
| undefined
|
||||
>
|
||||
checkForUpdates(): Promise<{ isUpdateAvailable?: boolean; updateInfo?: { version?: string } } | null | undefined>
|
||||
downloadUpdate(): Promise<unknown>
|
||||
quitAndInstall(): void
|
||||
}
|
||||
|
|
@ -58,7 +54,9 @@ export function createUpdaterController(input: {
|
|||
await input.persistence.set({ version })
|
||||
return transition({ status: "ready", version })
|
||||
})()
|
||||
.catch((error) => transition({ status: "error", message: error instanceof Error ? error.message : String(error) }))
|
||||
.catch((error) =>
|
||||
transition({ status: "error", message: error instanceof Error ? error.message : String(error) }),
|
||||
)
|
||||
.finally(() => {
|
||||
pending = undefined
|
||||
})
|
||||
|
|
|
|||
|
|
@ -42,10 +42,7 @@ export function setupAutoUpdater(stop: () => Promise<void>) {
|
|||
})
|
||||
}
|
||||
|
||||
export async function showUpdaterDialog(
|
||||
controller: ReturnType<typeof setupAutoUpdater>,
|
||||
alertOnFail: boolean,
|
||||
) {
|
||||
export async function showUpdaterDialog(controller: ReturnType<typeof setupAutoUpdater>, alertOnFail: boolean) {
|
||||
const state = await controller.check()
|
||||
if (state.status === "error") {
|
||||
if (!alertOnFail) return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue