diff options
| author | Adam <[email protected]> | 2025-12-19 07:38:33 -0600 |
|---|---|---|
| committer | Adam <[email protected]> | 2025-12-19 07:38:38 -0600 |
| commit | e1ad2a355c84422ef8c6a20f998bc71f2881713a (patch) | |
| tree | b37c2dc4ff16bf6d9fcfd83f35a2ff5aea37d5aa /packages/desktop/src/context/platform.tsx | |
| parent | 4f318f913e034ccd2fe4456461bf56b22a37eed9 (diff) | |
| download | opencode-e1ad2a355c84422ef8c6a20f998bc71f2881713a.tar.gz opencode-e1ad2a355c84422ef8c6a20f998bc71f2881713a.zip | |
fix(desktop): error handling
Diffstat (limited to 'packages/desktop/src/context/platform.tsx')
| -rw-r--r-- | packages/desktop/src/context/platform.tsx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/packages/desktop/src/context/platform.tsx b/packages/desktop/src/context/platform.tsx index 2ac9f64d4..73d4c7f3e 100644 --- a/packages/desktop/src/context/platform.tsx +++ b/packages/desktop/src/context/platform.tsx @@ -5,6 +5,12 @@ export type Platform = { /** Platform discriminator */ platform: "web" | "tauri" + /** Open a URL in the default browser */ + openLink(url: string): void + + /** Restart the app */ + restart(): Promise<void> + /** Open native directory picker dialog (Tauri only) */ openDirectoryPickerDialog?(opts?: { title?: string; multiple?: boolean }): Promise<string | string[] | null> @@ -14,9 +20,6 @@ export type Platform = { /** Save file picker dialog (Tauri only) */ saveFilePickerDialog?(opts?: { title?: string; defaultPath?: string }): Promise<string | null> - /** Open a URL in the default browser */ - openLink(url: string): void - /** Storage mechanism, defaults to localStorage */ storage?: (name?: string) => SyncStorage | AsyncStorage @@ -25,6 +28,9 @@ export type Platform = { /** Install updates (Tauri only) */ update?(): Promise<void> + + /** Fetch override */ + fetch?: typeof fetch } export const { use: usePlatform, provider: PlatformProvider } = createSimpleContext({ |
