Skip to content

Commit 3002c3f

Browse files
author
Bogdan Tsechoev
committed
Merge branch 'streaming_scrolldown_fix' into 'master'
Bot UI: Fix scroll during streaming See merge request postgres-ai/database-lab!902
2 parents 25e5c0d + 956bdef commit 3002c3f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ui/packages/platform/src/pages/Bot/Messages/Messages.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ export const Messages = React.memo(() => {
125125
loading: isLoading,
126126
wsLoading: isWaitingForAnswer,
127127
stateMessage,
128-
currentStreamMessage
128+
currentStreamMessage,
129+
isStreamingInProcess
129130
} = useAiBot();
130131

131132
const rootRef = useRef<HTMLDivElement>(null);
@@ -174,10 +175,10 @@ export const Messages = React.memo(() => {
174175
}, [prevUserMessagesCount, userMessagesCount]);
175176

176177
useEffect(() => {
177-
if (!isLoading) {
178+
if (!isLoading && !isStreamingInProcess) {
178179
scrollBottomIfNeed();
179180
}
180-
}, [isLoading, scrollBottomIfNeed]);
181+
}, [isLoading, scrollBottomIfNeed, isStreamingInProcess]);
181182

182183
useEffect(() => {
183184
const updateTimes = () => {

0 commit comments

Comments
 (0)