fix(account): update sync range and handle all-mode reset

This commit is contained in:
rustmailer
2025-12-31 22:57:20 +08:00
parent a6216c2ce6
commit ef891b20c3
3 changed files with 22 additions and 13 deletions
@@ -290,7 +290,11 @@ export function AccountActionDialog({ currentRow, open, onOpenChange }: Props) {
sync_batch_size: data.sync_batch_size,
};
if (isEdit) {
updateMutation.mutate(commonData);
const isAllMode = !data.date_since && !data.date_before;
updateMutation.mutate({
...commonData,
...(isAllMode ? { clear_date_range: true } : {})
});
} else {
createMutation.mutate({ ...commonData, account_type: "IMAP" });
}