feat(chat): implement pull-to-refresh functionality and pagination for chat history
This commit is contained in:
@@ -17,6 +17,8 @@ export type ReadAndSyncHistoryOutput = {
|
||||
localOverwritten: boolean;
|
||||
localCount: number;
|
||||
networkCount: number;
|
||||
total: number;
|
||||
limit: number;
|
||||
};
|
||||
|
||||
export type LocalHistorySnapshotOutput = {
|
||||
@@ -121,6 +123,8 @@ export async function syncNetworkHistory(
|
||||
localOverwritten,
|
||||
localCount,
|
||||
networkCount: networkUi.length,
|
||||
total: networkResult.data.total,
|
||||
limit: networkResult.data.limit,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -144,5 +148,7 @@ export async function readAndSyncHistory(): Promise<ReadAndSyncHistoryOutput> {
|
||||
localOverwritten: false,
|
||||
localCount: localSnapshot.localCount,
|
||||
networkCount: 0,
|
||||
total: 0,
|
||||
limit: CHAT_HISTORY_LIMIT,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user