mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-21 10:42:33 +00:00
fix(app): cleanup pty.exited event listener on unmount (#9671)
This commit is contained in:
parent
156ce54362
commit
80481c2247
1 changed files with 2 additions and 1 deletions
|
|
@ -38,7 +38,7 @@ function createTerminalSession(sdk: ReturnType<typeof useSDK>, dir: string, sess
|
|||
}),
|
||||
)
|
||||
|
||||
sdk.event.on("pty.exited", (event) => {
|
||||
const unsub = sdk.event.on("pty.exited", (event) => {
|
||||
const id = event.properties.id
|
||||
if (!store.all.some((x) => x.id === id)) return
|
||||
batch(() => {
|
||||
|
|
@ -52,6 +52,7 @@ function createTerminalSession(sdk: ReturnType<typeof useSDK>, dir: string, sess
|
|||
}
|
||||
})
|
||||
})
|
||||
onCleanup(unsub)
|
||||
|
||||
return {
|
||||
ready,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue