优化事件处理

This commit is contained in:
xintaofei
2026-03-08 17:08:31 +08:00
parent 7a4cbcb73e
commit c1220e1a8f
12 changed files with 178 additions and 64 deletions

View File

@@ -36,6 +36,7 @@ import {
updateConversationStatus,
updateConversationExternalId,
} from "@/lib/tauri"
import { disposeTauriListener } from "@/lib/tauri-listener"
import { AgentSelector } from "@/components/chat/agent-selector"
import { LiveMessageBlock } from "@/components/chat/live-message-block"
import { AgentPlanOverlay } from "@/components/chat/agent-plan-overlay"
@@ -448,7 +449,7 @@ export function WelcomeInputPanel({
)
.then((dispose) => {
if (cancelled) {
dispose()
disposeTauriListener(dispose, "WelcomeInputPanel.agentsUpdated")
return
}
unlisten = dispose
@@ -463,9 +464,7 @@ export function WelcomeInputPanel({
clearTimeout(agentStatusRefreshTimerRef.current)
agentStatusRefreshTimerRef.current = null
}
if (unlisten) {
unlisten()
}
disposeTauriListener(unlisten, "WelcomeInputPanel.agentsUpdated")
}
}, [])