mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-14 12:44:36 +00:00
fix: dialog
This commit is contained in:
@@ -143,9 +143,17 @@ export function DialogTfMcp() {
|
||||
duration: 3000,
|
||||
})
|
||||
}
|
||||
const status = await sdk.client.mcp.status()
|
||||
if (status.data) {
|
||||
sync.set("mcp", reconcile(status.data))
|
||||
|
||||
// Poll until status reflects the change (MCP SSE handshake is async)
|
||||
const wantConnected = !isEnabled()
|
||||
for (let i = 0; i < 10; i++) {
|
||||
await new Promise((r) => setTimeout(r, 500))
|
||||
const status = await sdk.client.mcp.status()
|
||||
if (status.data) {
|
||||
sync.set("mcp", reconcile(status.data))
|
||||
const current = status.data[TF_MCP_NAME]?.status === "connected"
|
||||
if (current === wantConnected) break
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
toast.show({
|
||||
|
||||
Reference in New Issue
Block a user