mirror of
https://github.com/status-im/dappconnect-chat-sdk.git
synced 2025-01-14 00:20:57 +00:00
set chunk size
This commit is contained in:
parent
bd60c88767
commit
89279dbfbb
@ -5,8 +5,8 @@ import { handleChannelChatMessage } from './delete_handle-channel-chat-message'
|
||||
import type { MessageType } from './community'
|
||||
import type { Waku } from 'js-waku'
|
||||
|
||||
const CHUNK_SIZE = 2
|
||||
const PAGE_SIZE = 2
|
||||
const CHUNK_SIZE = 50
|
||||
const PAGE_SIZE = CHUNK_SIZE
|
||||
|
||||
export const fetchChannelChatMessages = async (
|
||||
waku: Waku,
|
||||
@ -86,6 +86,7 @@ export async function fetchMessages(
|
||||
}
|
||||
}
|
||||
|
||||
// todo?: remove chunking until PAGE_SIZE !== CHUNK_SIZE
|
||||
while (remainingFetchedMessages.length >= CHUNK_SIZE) {
|
||||
// reverse
|
||||
const _chunk = remainingFetchedMessages.splice(0, CHUNK_SIZE).reverse()
|
||||
|
Loading…
x
Reference in New Issue
Block a user