mirror of
https://fastgit.cc/https://github.com/anomalyco/opencode
synced 2026-04-30 22:00:53 +08:00
fix(tui): keep Zed context polling responsive (#24711)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user