From 517e650942670e8b530541151e638c24c2993a0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=B5=E6=91=87=E5=B0=8F=E5=AD=90?= <84499436+Wxw-Gu@users.noreply.github.com> Date: Fri, 4 Sep 2026 10:45:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E5=B7=B2=E5=8A=A0=E8=BD=BD=E7=9A=84=E5=8E=86=E5=8F=B2=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/App.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/renderer/src/App.tsx b/src/renderer/src/App.tsx index 4490ed8..5499a5a 100644 --- a/src/renderer/src/App.tsx +++ b/src/renderer/src/App.tsx @@ -1393,9 +1393,11 @@ function App(): React.ReactElement { if (disposed || selectedContactMd5Ref.current !== contactMd5) return const nextHistory = mergeMessagePages(messageHistoryRef.current, latestMessages) messageHistoryRef.current = nextHistory + // 监控刷新仅获取最新页面。保留用户已加载的历史记录数量,而不是将视图回滚到20条 + const visibleMessageCount = Math.max(INITIAL_MESSAGE_COUNT, messagesRef.current.length) const nextMessages = applyGroupMemberMeta( selectedContact, - mergeSyntheticMessages(selectedContact, nextHistory.slice(-INITIAL_MESSAGE_COUNT)) + mergeSyntheticMessages(selectedContact, nextHistory.slice(-visibleMessageCount)) ) if (!disposed && selectedContactMd5Ref.current === contactMd5) { setMessages((current) =>