From b86c29c6a47938436eae69965ae2212eef966195 Mon Sep 17 00:00:00 2001 From: shumengya Date: Mon, 15 Jun 2026 14:35:05 +0800 Subject: [PATCH] fix: remove SSE connection failure notice timer Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/context/ChatContext.tsx | 9 --------- 1 file changed, 9 deletions(-) diff --git a/frontend/src/context/ChatContext.tsx b/frontend/src/context/ChatContext.tsx index 6ad0689..8c4aded 100644 --- a/frontend/src/context/ChatContext.tsx +++ b/frontend/src/context/ChatContext.tsx @@ -1844,8 +1844,6 @@ export function ChatProvider({ children }: { children: ReactNode }) { let eventSource: EventSource | null = null; let reconnectTimer: ReturnType | null = null; - let sseNoticeTimer: ReturnType | null = null; - let sseNoticeShown = false; const connect = () => { if (eventSource) eventSource.close(); @@ -1869,12 +1867,6 @@ export function ChatProvider({ children }: { children: ReactNode }) { connect(); - sseNoticeTimer = setTimeout(() => { - if (cancelled || sseNoticeShown) return; - sseNoticeShown = true; - addSystemMessageRef.current("无法连接实时事件流,请确认 WebUI 已启动且穿透域名可访问"); - }, 12_000); - return () => { cancelled = true; window.removeEventListener("resize", onResize); @@ -1882,7 +1874,6 @@ export function ChatProvider({ children }: { children: ReactNode }) { window.visualViewport?.removeEventListener("scroll", syncViewportHeight); window.removeEventListener("orientationchange", syncViewportHeight); if (reconnectTimer) clearTimeout(reconnectTimer); - if (sseNoticeTimer) clearTimeout(sseNoticeTimer); eventSource?.close(); }; }, []);