@@ -9,7 +9,6 @@ import updateMessages from './updateMessages';
99import { generateLoadMoreId } from './helpers/generateLoadMoreId' ;
1010
1111const COUNT = 50 ;
12- const COUNT_LIMIT = COUNT * 10 ;
1312
1413async function load ( { rid : roomId , latest, t } : { rid : string ; latest ?: Date ; t : RoomTypes } ) : Promise < IMessage [ ] > {
1514 const apiType = roomTypeToApiType ( t ) ;
@@ -21,11 +20,11 @@ async function load({ rid: roomId, latest, t }: { rid: string; latest?: Date; t:
2120 let mainMessagesCount = 0 ;
2221
2322 async function fetchBatch ( lastTs ?: string ) : Promise < void > {
24- if ( allMessages . length >= COUNT_LIMIT ) {
23+ if ( allMessages . length >= COUNT ) {
2524 return ;
2625 }
2726
28- const params = { roomId, count : COUNT , ...( lastTs && { latest : lastTs } ) } ;
27+ const params = { roomId, showThreadMessages : false , count : COUNT , ...( lastTs && { latest : lastTs } ) } ;
2928
3029 let data ;
3130 switch ( apiType ) {
@@ -77,7 +76,7 @@ export function loadMessagesForRoom(args: {
7776 if ( data ?. length ) {
7877 const lastMessage = data [ data . length - 1 ] ;
7978 const lastMessageRecord = await getMessageById ( lastMessage . _id as string ) ;
80- if ( ! lastMessageRecord && ( data . length === COUNT || data . length >= COUNT_LIMIT ) ) {
79+ if ( ! lastMessageRecord && data . length === COUNT ) {
8180 const loadMoreMessage = {
8281 _id : generateLoadMoreId ( lastMessage . _id as string ) ,
8382 rid : lastMessage . rid ,
0 commit comments