mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
fix(tui): resolve session_status TypeError (#5520)
This commit is contained in:
parent
b5e97eb338
commit
69e562125d
4 changed files with 4 additions and 4 deletions
|
|
@ -37,7 +37,7 @@ export function DialogSessionList() {
|
|||
category = "Today"
|
||||
}
|
||||
const isDeleting = toDelete() === x.id
|
||||
const status = sync.data.session_status[x.id]
|
||||
const status = sync.data.session_status?.[x.id]
|
||||
const isWorking = status?.type === "busy"
|
||||
return {
|
||||
title: isDeleting ? `Press ${deleteKeybind} again to confirm` : x.title,
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ export function Prompt(props: PromptProps) {
|
|||
const sync = useSync()
|
||||
const dialog = useDialog()
|
||||
const toast = useToast()
|
||||
const status = createMemo(() => sync.data.session_status[props.sessionID ?? ""] ?? { type: "idle" })
|
||||
const status = createMemo(() => sync.data.session_status?.[props.sessionID ?? ""] ?? { type: "idle" })
|
||||
const history = usePromptHistory()
|
||||
const command = useCommandDialog()
|
||||
const renderer = useRenderer()
|
||||
|
|
|
|||
|
|
@ -340,7 +340,7 @@ export function Session() {
|
|||
keybind: "messages_undo",
|
||||
category: "Session",
|
||||
onSelect: async (dialog) => {
|
||||
const status = sync.data.session_status[route.sessionID]
|
||||
const status = sync.data.session_status?.[route.sessionID]
|
||||
if (status?.type !== "idle") await sdk.client.session.abort({ sessionID: route.sessionID }).catch(() => {})
|
||||
const revert = session().revert?.messageID
|
||||
const message = messages().findLast((x) => (!revert || x.id < revert) && x.role === "user")
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ export namespace SessionStatus {
|
|||
}
|
||||
|
||||
export function list() {
|
||||
return Object.values(state())
|
||||
return state()
|
||||
}
|
||||
|
||||
export function set(sessionID: string, status: Info) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue