diff --git a/src/pages/ChatPage.tsx b/src/pages/ChatPage.tsx index 9da3b4e..9a49bdc 100644 --- a/src/pages/ChatPage.tsx +++ b/src/pages/ChatPage.tsx @@ -3050,6 +3050,7 @@ function ChatPage(props: ChatPageProps) { } // 日期跳转时滚动到顶部,否则滚动到底部 + const loadedMessages = result.messages requestAnimationFrame(() => { if (isDateJumpRef.current) { if (messageVirtuosoRef.current && resultMessages.length > 0) { @@ -3084,6 +3085,7 @@ function ChatPage(props: ChatPageProps) { } // 加载更早消息后保持视口锚点,避免跳屏 + const appendedMessages = result.messages requestAnimationFrame(() => { if (messageVirtuosoRef.current) { if (anchorMessageKeyBeforePrepend) { @@ -5655,7 +5657,7 @@ function ChatPage(props: ChatPageProps) { )}