Bug:修复ts错误
This commit is contained in:
@@ -252,7 +252,6 @@ function App() {
|
|||||||
page={page}
|
page={page}
|
||||||
loading={loading}
|
loading={loading}
|
||||||
hasMore={hasMore}
|
hasMore={hasMore}
|
||||||
refreshing={refreshing}
|
|
||||||
containerRef={containerRef}
|
containerRef={containerRef}
|
||||||
lastArticleRef={lastArticleRef}
|
lastArticleRef={lastArticleRef}
|
||||||
onWheel={onWheel}
|
onWheel={onWheel}
|
||||||
@@ -263,7 +262,6 @@ function App() {
|
|||||||
handleNewPost={handleNewPost}
|
handleNewPost={handleNewPost}
|
||||||
handleNewPostBarDismiss={handleNewPostBarDismiss}
|
handleNewPostBarDismiss={handleNewPostBarDismiss}
|
||||||
isDebugMode={isDebugMode}
|
isDebugMode={isDebugMode}
|
||||||
showDevTools={showDevTools}
|
|
||||||
setShowDevTools={setShowDevTools}
|
setShowDevTools={setShowDevTools}
|
||||||
/>
|
/>
|
||||||
<ToastContainer theme={isDarkMode ? 'dark' : 'light'} />
|
<ToastContainer theme={isDarkMode ? 'dark' : 'light'} />
|
||||||
@@ -315,7 +313,6 @@ function AppContent({
|
|||||||
articles,
|
articles,
|
||||||
loading,
|
loading,
|
||||||
hasMore,
|
hasMore,
|
||||||
refreshing,
|
|
||||||
containerRef,
|
containerRef,
|
||||||
lastArticleRef,
|
lastArticleRef,
|
||||||
onWheel,
|
onWheel,
|
||||||
@@ -326,7 +323,6 @@ function AppContent({
|
|||||||
handleNewPost,
|
handleNewPost,
|
||||||
handleNewPostBarDismiss,
|
handleNewPostBarDismiss,
|
||||||
isDebugMode,
|
isDebugMode,
|
||||||
showDevTools,
|
|
||||||
setShowDevTools,
|
setShowDevTools,
|
||||||
}: any) {
|
}: any) {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
@@ -373,7 +369,7 @@ function AppContent({
|
|||||||
// 移除下拉位移动画
|
// 移除下拉位移动画
|
||||||
}}>
|
}}>
|
||||||
{/* 刷新提示改为 toast,不显示顶部灰字 */}
|
{/* 刷新提示改为 toast,不显示顶部灰字 */}
|
||||||
{articles.map((article, index) => {
|
{articles.map((article: { id: number; content: string; upvotes: number; downvotes: number }, index: number) => {
|
||||||
if (articles.length === index + 1 && hasMore) {
|
if (articles.length === index + 1 && hasMore) {
|
||||||
return (
|
return (
|
||||||
<div ref={lastArticleRef} key={article.id}>
|
<div ref={lastArticleRef} key={article.id}>
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export function useSSE(options: UseSSEOptions = {}) {
|
|||||||
const [isConnected, setIsConnected] = useState(false);
|
const [isConnected, setIsConnected] = useState(false);
|
||||||
const eventSourceRef = useRef<EventSource | null>(null);
|
const eventSourceRef = useRef<EventSource | null>(null);
|
||||||
const retriesRef = useRef(0);
|
const retriesRef = useRef(0);
|
||||||
const reconnectTimeoutRef = useRef<NodeJS.Timeout | null>(null);
|
const reconnectTimeoutRef = useRef<number | null>(null);
|
||||||
const onNewPostRef = useRef(onNewPost);
|
const onNewPostRef = useRef(onNewPost);
|
||||||
|
|
||||||
// 更新 ref 以获取最新的回调
|
// 更新 ref 以获取最新的回调
|
||||||
|
|||||||
Reference in New Issue
Block a user