mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-19 16:40:48 +00:00
fix(tui): keep Zed context polling responsive (#24711)
This commit is contained in:
parent
937a7c48a5
commit
4d74849c1a
1 changed files with 7 additions and 1 deletions
|
|
@ -116,6 +116,12 @@ export const { use: useEditorContext, provider: EditorContextProvider } = create
|
|||
reconnect = setTimeout(connect, delay)
|
||||
}
|
||||
|
||||
const scheduleZedPoll = () => {
|
||||
if (closed) return
|
||||
if (reconnect) clearTimeout(reconnect)
|
||||
reconnect = setTimeout(connect, 1000)
|
||||
}
|
||||
|
||||
const connect = () => {
|
||||
if (closed) return
|
||||
|
||||
|
|
@ -145,7 +151,7 @@ export const { use: useEditorContext, provider: EditorContextProvider } = create
|
|||
.finally(() => {
|
||||
zedSelection = undefined
|
||||
})
|
||||
scheduleReconnect()
|
||||
scheduleZedPoll()
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue