fix: 发送消息时强制resetAutoScroll,解决手动上滑后新消息不自动滚动的问题
This commit is contained in:
@@ -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 : [];
|
||||
|
||||
Reference in New Issue
Block a user