chore: generate
This commit is contained in:
parent
9b4d5b0395
commit
7a2c49e762
4 changed files with 8 additions and 18 deletions
|
|
@ -3,12 +3,7 @@ export { ACCEPTED_FILE_EXTENSIONS, ACCEPTED_FILE_TYPES, filePickerFilters } from
|
||||||
export { useCommand } from "./context/command"
|
export { useCommand } from "./context/command"
|
||||||
export { loadLocaleDict, normalizeLocale, type Locale } from "./context/language"
|
export { loadLocaleDict, normalizeLocale, type Locale } from "./context/language"
|
||||||
export { useWslServers } from "./wsl/context"
|
export { useWslServers } from "./wsl/context"
|
||||||
export {
|
export { type DisplayBackend, type FatalRendererErrorLog, type Platform, PlatformProvider } from "./context/platform"
|
||||||
type DisplayBackend,
|
|
||||||
type FatalRendererErrorLog,
|
|
||||||
type Platform,
|
|
||||||
PlatformProvider,
|
|
||||||
} from "./context/platform"
|
|
||||||
export { type UpdaterPlatform, type UpdaterState } from "./updater"
|
export { type UpdaterPlatform, type UpdaterState } from "./updater"
|
||||||
export {
|
export {
|
||||||
type WslDistroProbe,
|
type WslDistroProbe,
|
||||||
|
|
|
||||||
|
|
@ -250,8 +250,8 @@ export const ErrorPage: Component<ErrorPageProps> = (props) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function installUpdate() {
|
async function installUpdate() {
|
||||||
await platform
|
await platform.updater
|
||||||
.updater?.install()
|
?.install()
|
||||||
.then(() => setStore("actionError", undefined))
|
.then(() => setStore("actionError", undefined))
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
setStore("actionError", formatError(err, language.t))
|
setStore("actionError", formatError(err, language.t))
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,7 @@ export type { UpdaterState } from "@opencode-ai/app/updater"
|
||||||
export type UpdaterReadyRecord = { version: string }
|
export type UpdaterReadyRecord = { version: string }
|
||||||
|
|
||||||
export type UpdaterBackend = {
|
export type UpdaterBackend = {
|
||||||
checkForUpdates(): Promise<
|
checkForUpdates(): Promise<{ isUpdateAvailable?: boolean; updateInfo?: { version?: string } } | null | undefined>
|
||||||
| { isUpdateAvailable?: boolean; updateInfo?: { version?: string } }
|
|
||||||
| null
|
|
||||||
| undefined
|
|
||||||
>
|
|
||||||
downloadUpdate(): Promise<unknown>
|
downloadUpdate(): Promise<unknown>
|
||||||
quitAndInstall(): void
|
quitAndInstall(): void
|
||||||
}
|
}
|
||||||
|
|
@ -58,7 +54,9 @@ export function createUpdaterController(input: {
|
||||||
await input.persistence.set({ version })
|
await input.persistence.set({ version })
|
||||||
return transition({ status: "ready", 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(() => {
|
.finally(() => {
|
||||||
pending = undefined
|
pending = undefined
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -42,10 +42,7 @@ export function setupAutoUpdater(stop: () => Promise<void>) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function showUpdaterDialog(
|
export async function showUpdaterDialog(controller: ReturnType<typeof setupAutoUpdater>, alertOnFail: boolean) {
|
||||||
controller: ReturnType<typeof setupAutoUpdater>,
|
|
||||||
alertOnFail: boolean,
|
|
||||||
) {
|
|
||||||
const state = await controller.check()
|
const state = await controller.check()
|
||||||
if (state.status === "error") {
|
if (state.status === "error") {
|
||||||
if (!alertOnFail) return
|
if (!alertOnFail) return
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue