Skip to content

Commit a1596ab

Browse files
fix: added extra check to avoid failure in scrollToIndex
1 parent 762f4f3 commit a1596ab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/MessageList/MessageList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ const MessageListWithContext = <
479479
* 2. Message was sent by me (current logged in user)
480480
*/
481481
const scrollToBottomIfNeeded = () => {
482-
if (!client || !channel) {
482+
if (!client || !channel || messageList.length === 0) {
483483
return;
484484
}
485485

0 commit comments

Comments
 (0)