Skip to content

Commit 956bdef

Browse files
author
Bogdan Tsechoev
committed
Bot UI: Fix scroll during streaming
1 parent e7e7dac commit 956bdef

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)