Skip to content

Commit d06d32c

Browse files
authored
fix: pagination breaking during pruning (#3254)
1 parent 48385b8 commit d06d32c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

package/src/components/MessageList/MessageList.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -637,8 +637,13 @@ const MessageListWithContext = (props: MessageListPropsWithContext) => {
637637
}
638638
};
639639

640-
if (!maximumMessageLimit && (threadList || isMessageRemovedFromMessageList)) {
641-
scrollToBottomIfNeeded();
640+
if (threadList || isMessageRemovedFromMessageList) {
641+
if (maximumMessageLimit) {
642+
// pruning has happened, reset the trackers
643+
resetPaginationTrackersRef.current();
644+
} else {
645+
scrollToBottomIfNeeded();
646+
}
642647
}
643648

644649
messageListLengthBeforeUpdate.current = messageListLengthAfterUpdate;

0 commit comments

Comments
 (0)