Skip to content

Commit

Permalink
Fix issue where pending tabs show empty list
Browse files Browse the repository at this point in the history
Issue caused by the first page is having all its message blocked
  • Loading branch information
teodorus-nathaniel committed Jul 15, 2024
1 parent c1a7fc7 commit 41306d6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/components/chats/ChatList/ChatList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,18 @@ function ChatListContent({
onlyDisplayUnapprovedMessages,
})

const filteredIdsCount = messageIds.length
const unfilteredIdsCount = unfilteredMessageIds.length
useEffect(() => {
if (!scrollContainerRef.current) return
if (
scrollContainerRef.current.scrollHeight <=
scrollContainerRef.current.clientHeight
) {
loadMore()
}
}, [filteredIdsCount, unfilteredIdsCount, loadMore, scrollContainerRef])

const lastFocusedTime = useLastFocusedMessageTime(chatId, messageIds[0] ?? '')

useEffect(() => {
Expand Down

0 comments on commit 41306d6

Please sign in to comment.