diff --git a/app/components/emails/message-list.tsx b/app/components/emails/message-list.tsx index 9d3e2a0..2015849 100644 --- a/app/components/emails/message-list.tsx +++ b/app/components/emails/message-list.tsx @@ -52,7 +52,7 @@ export function MessageList({ email, messageType, onMessageSelect, selectedMessa const [refreshing, setRefreshing] = useState(false) const [nextCursor, setNextCursor] = useState(null) const [loadingMore, setLoadingMore] = useState(false) - const pollTimeoutRef = useRef() + const pollTimeoutRef = useRef(null) const messagesRef = useRef([]) // 添加 ref 来追踪最新的消息列表 const [total, setTotal] = useState(0) const [messageToDelete, setMessageToDelete] = useState(null) @@ -118,7 +118,7 @@ export function MessageList({ email, messageType, onMessageSelect, selectedMessa const stopPolling = () => { if (pollTimeoutRef.current) { clearInterval(pollTimeoutRef.current) - pollTimeoutRef.current = undefined + pollTimeoutRef.current = null } }