fix: mail grouping loads all mails at once with large page_size, no infinite scroll during grouping
This commit is contained in:
@@ -487,10 +487,11 @@ export function syncFolder(folderId: string): Promise<{ synced: number; error?:
|
||||
|
||||
// ─── Mails ──────────────────────────────────────────────────────────────────
|
||||
|
||||
export function fetchMails(folderId: string, page: number, sortBy?: string, sortOrder?: string): Promise<MailListResult> {
|
||||
export function fetchMails(folderId: string, page: number, sortBy?: string, sortOrder?: string, pageSize?: number): Promise<MailListResult> {
|
||||
const params = new URLSearchParams({ folder_id: folderId, page: String(page) });
|
||||
if (sortBy) params.set('sort_by', sortBy);
|
||||
if (sortOrder) params.set('sort_order', sortOrder);
|
||||
if (pageSize) params.set('page_size', String(pageSize));
|
||||
return apiGet<MailListResult>(`/mail?${params.toString()}`);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user