fix(desktop): error handling

This commit is contained in:
Adam
2025-12-19 07:38:33 -06:00
parent 4f318f913e
commit e1ad2a355c
15 changed files with 227 additions and 29 deletions

View File

@@ -21,6 +21,8 @@ import { Binary } from "@opencode-ai/util/binary"
import { useGlobalSDK } from "./global-sdk"
import { ErrorPage, type InitError } from "../pages/error"
import { createContext, useContext, onMount, type ParentProps, Switch, Match } from "solid-js"
import { showToast } from "@opencode-ai/ui/toast"
import { getFilename } from "@opencode-ai/util/path"
type State = {
ready: boolean
@@ -118,7 +120,8 @@ function createGlobalSync() {
})
.catch((err) => {
console.error("Failed to load sessions", err)
setGlobalStore("error", err)
const project = getFilename(directory)
showToast({ title: `Failed to load sessions for ${project}`, description: err.message })
})
}