mirror of
https://github.com/beilunyang/moemail.git
synced 2025-10-08 08:50:15 +08:00
feat: profile page & webhook notification
This commit is contained in:
@@ -35,7 +35,7 @@ export function MessageList({ email, onMessageSelect, selectedMessageId }: Messa
|
||||
const [refreshing, setRefreshing] = useState(false)
|
||||
const [nextCursor, setNextCursor] = useState<string | null>(null)
|
||||
const [loadingMore, setLoadingMore] = useState(false)
|
||||
const pollTimeoutRef = useRef<NodeJS.Timeout>()
|
||||
const pollTimeoutRef = useRef<Timer>()
|
||||
const messagesRef = useRef<Message[]>([]) // 添加 ref 来追踪最新的消息列表
|
||||
const [total, setTotal] = useState(0)
|
||||
|
||||
@@ -85,7 +85,7 @@ export function MessageList({ email, onMessageSelect, selectedMessageId }: Messa
|
||||
}
|
||||
|
||||
const startPolling = () => {
|
||||
stopPolling() // 先清除之前的轮询
|
||||
stopPolling()
|
||||
pollTimeoutRef.current = setInterval(() => {
|
||||
if (!refreshing && !loadingMore) {
|
||||
fetchMessages()
|
||||
|
Reference in New Issue
Block a user