app: use session_working helper to simplify loading states (#27212)

This commit is contained in:
Brendan Allan 2026-05-13 10:27:05 +08:00 committed by GitHub
commit 2f4dce789f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 10 additions and 26 deletions

View file

@ -240,13 +240,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
return paths
})
const info = createMemo(() => (params.id ? sync.session.get(params.id) : undefined))
const status = createMemo(
() =>
sync.data.session_status[params.id ?? ""] ?? {
type: "idle",
},
)
const working = createMemo(() => status()?.type !== "idle")
const working = createMemo(() => sync.data.session_working(params.id ?? ""))
const imageAttachments = createMemo(() =>
prompt.current().filter((part): part is ImageAttachmentPart => part.type === "image"),
)