fix: image reading error, also add error toast for event bus

This commit is contained in:
Aiden Cline
2025-11-04 17:29:27 -06:00
parent d3e080894c
commit 01b9148c04
2 changed files with 72 additions and 25 deletions

View File

@@ -367,6 +367,27 @@ function App() {
}
})
event.on(SessionApi.Event.Error.type, (evt) => {
const error = evt.properties.error
const message = (() => {
if (!error) return "An error occured"
if (typeof error === "object") {
const data = error.data
if ("message" in data && typeof data.message === "string") {
return data.message
}
}
return String(error)
})()
toast.show({
variant: "error",
message,
duration: 5000,
})
})
return (
<box
width={dimensions().width}