fix: 发送消息时强制resetAutoScroll,解决手动上滑后新消息不自动滚动的问题

This commit is contained in:
thzxx
2026-06-12 14:57:08 +08:00
parent 5cf961df84
commit 8b50ae323f
2 changed files with 8 additions and 1 deletions
+6
View File
@@ -102,6 +102,12 @@ export function scrollToBottom(): void {
});
}
/** 发送新消息时重置自动滚动,确保新消息可见 */
export function resetAutoScroll(): void {
autoScroll = true;
if (scrollBtnEl) scrollBtnEl.style.display = 'none';
}
export function renderMessages(): void {
const currentSession = state.get<ChatSession | null>(KEYS.CURRENT_SESSION);
const msgs = currentSession ? currentSession.messages : [];