feat(chat): implement pull-to-refresh functionality and pagination for chat history
This commit is contained in:
@@ -131,6 +131,10 @@ export function createTestChatMachine(
|
||||
export function createLoadHistoryCallback(
|
||||
messages: UiMessage[],
|
||||
networkMessages: UiMessage[] = messages,
|
||||
pagination: { total: number; limit: number } = {
|
||||
total: networkMessages.length,
|
||||
limit: 50,
|
||||
},
|
||||
) {
|
||||
return fromCallback<ChatEvent>(({ sendBack }) => {
|
||||
sendBack({
|
||||
@@ -147,6 +151,8 @@ export function createLoadHistoryCallback(
|
||||
localOverwritten: true,
|
||||
localCount: messages.length,
|
||||
networkCount: networkMessages.length,
|
||||
total: pagination.total,
|
||||
limit: pagination.limit,
|
||||
},
|
||||
});
|
||||
return () => undefined;
|
||||
|
||||
Reference in New Issue
Block a user