fix: stop silently destroying emails when trash mailbox isnt found #195

This commit is contained in:
Linus Rath
2026-05-01 20:01:13 +02:00
parent e50691d6c4
commit eecf16daa2
3 changed files with 96 additions and 18 deletions
+8
View File
@@ -178,6 +178,14 @@ export function EmailList({
setIsProcessing(true);
try {
await batchDelete(client, isInTrash);
const storeError = useEmailStore.getState().error;
if (storeError) {
const { toast } = await import('sonner');
toast.error(storeError);
}
} catch (err) {
const { toast } = await import('sonner');
toast.error(err instanceof Error ? err.message : 'Failed to delete emails');
} finally {
setTimeout(() => setIsProcessing(false), 500);
}