Skip to content

Commit c0f3fb5

Browse files
authored
fix: regenerate scroll bottom (#4348)
1 parent c77275a commit c0f3fb5

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • web/screens/Thread/ThreadCenterPanel/ChatBody

web/screens/Thread/ThreadCenterPanel/ChatBody/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,20 +86,23 @@ const ChatBody = memo(
8686
})
8787

8888
useEffect(() => {
89+
isUserManuallyScrollingUp.current = false
8990
if (parentRef.current) {
9091
parentRef.current.scrollTo({ top: parentRef.current.scrollHeight })
9192
virtualizer.scrollToIndex(count - 1)
9293
}
9394
}, [count, virtualizer])
9495

9596
useEffect(() => {
97+
isUserManuallyScrollingUp.current = false
9698
if (parentRef.current && isGeneratingResponse) {
9799
parentRef.current.scrollTo({ top: parentRef.current.scrollHeight })
98100
virtualizer.scrollToIndex(count - 1)
99101
}
100102
}, [count, virtualizer, isGeneratingResponse])
101103

102104
useEffect(() => {
105+
isUserManuallyScrollingUp.current = false
103106
if (parentRef.current && isGeneratingResponse) {
104107
parentRef.current.scrollTo({ top: parentRef.current.scrollHeight })
105108
virtualizer.scrollToIndex(count - 1)

0 commit comments

Comments
 (0)