From ff3a058f290017f22bf560ef5bc621ebe2ee5e88 Mon Sep 17 00:00:00 2001 From: yml2213 Date: Sun, 19 Jul 2026 01:13:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AE=BF=E5=AE=A2=E7=AB=AF?= =?UTF-8?q?=E6=9C=AA=E4=BD=BF=E7=94=A8=20emitTyping=20=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=E6=9E=84=E5=BB=BA=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 删除已被 input_draft 替代的死代码,通过 tsc 严格未使用检查。 --- web/src/widgets/VisitorChat.tsx | 9 --------- 1 file changed, 9 deletions(-) diff --git a/web/src/widgets/VisitorChat.tsx b/web/src/widgets/VisitorChat.tsx index baa5a44..7278d13 100644 --- a/web/src/widgets/VisitorChat.tsx +++ b/web/src/widgets/VisitorChat.tsx @@ -720,15 +720,6 @@ const VisitorChat = ({ })) }, [sessionId, sessionEnded]) - const emitTyping = () => { - // 兼容:无正文的旧 typing;正文走 emitInputDraft - if (!sessionId || sessionEnded || !agentsOnline) return - const now = Date.now() - if (now - lastTypingAt.current < 1200 || socketRef.current?.readyState !== WebSocket.OPEN) return - lastTypingAt.current = now - socketRef.current.send(JSON.stringify({ type: 'typing', session_id: sessionId })) - } - const postMessage = async (content: string, type: 'text' | 'image') => { if (!sessionId || !visitorToken) throw new Error('会话未就绪') const res = await fetch('/api/widget/message', {