Fix infinite pagination of chats
This commit is contained in:
parent
4a48e9d510
commit
9cc9e8876b
|
@ -169,7 +169,10 @@ const useChats = (search?: string) => {
|
|||
},
|
||||
});
|
||||
|
||||
const data = flattenPages(queryInfo.data);
|
||||
const data = queryInfo.data?.pages.reduce<IChat[]>(
|
||||
(prev: IChat[], curr) => [...prev, ...curr.result],
|
||||
[],
|
||||
);
|
||||
|
||||
const chatsQuery = {
|
||||
...queryInfo,
|
||||
|
|
Loading…
Reference in New Issue