From 3e3cc212dd1da456858828f55c81e13e107035e1 Mon Sep 17 00:00:00 2001 From: LeonspaceX Date: Tue, 16 Dec 2025 22:13:21 +0800 Subject: [PATCH] =?UTF-8?q?Bug:=E4=BF=AE=E5=A4=8Dts=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.tsx | 6 +----- src/hooks/useSSE.ts | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 0a5362d..753006e 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -252,7 +252,6 @@ function App() { page={page} loading={loading} hasMore={hasMore} - refreshing={refreshing} containerRef={containerRef} lastArticleRef={lastArticleRef} onWheel={onWheel} @@ -263,7 +262,6 @@ function App() { handleNewPost={handleNewPost} handleNewPostBarDismiss={handleNewPostBarDismiss} isDebugMode={isDebugMode} - showDevTools={showDevTools} setShowDevTools={setShowDevTools} /> @@ -315,7 +313,6 @@ function AppContent({ articles, loading, hasMore, - refreshing, containerRef, lastArticleRef, onWheel, @@ -326,7 +323,6 @@ function AppContent({ handleNewPost, handleNewPostBarDismiss, isDebugMode, - showDevTools, setShowDevTools, }: any) { const navigate = useNavigate(); @@ -373,7 +369,7 @@ function AppContent({ // 移除下拉位移动画 }}> {/* 刷新提示改为 toast,不显示顶部灰字 */} - {articles.map((article, index) => { + {articles.map((article: { id: number; content: string; upvotes: number; downvotes: number }, index: number) => { if (articles.length === index + 1 && hasMore) { return (
diff --git a/src/hooks/useSSE.ts b/src/hooks/useSSE.ts index fd78962..3117777 100644 --- a/src/hooks/useSSE.ts +++ b/src/hooks/useSSE.ts @@ -17,7 +17,7 @@ export function useSSE(options: UseSSEOptions = {}) { const [isConnected, setIsConnected] = useState(false); const eventSourceRef = useRef(null); const retriesRef = useRef(0); - const reconnectTimeoutRef = useRef(null); + const reconnectTimeoutRef = useRef(null); const onNewPostRef = useRef(onNewPost); // 更新 ref 以获取最新的回调