feat: add post-export action setting (keep/archive/trash)

This commit is contained in:
Linus Rath
2026-05-22 15:36:15 +02:00
parent e3f6ae874d
commit 58e4a3d117
20 changed files with 137 additions and 0 deletions
+4
View File
@@ -3094,7 +3094,11 @@ export function EmailViewer({
await client.downloadBlob(email.blobId, emailExportFilename(email, emailFilenameOptions), 'message/rfc822');
} catch {
toast.error(tNotifications('export_email_error'));
return;
}
const action = useSettingsStore.getState().postExportAction;
if (action === 'archive') onArchive?.();
else if (action === 'trash') onDelete?.();
};
// Import email from .eml file or .zip archive containing .eml files
@@ -138,6 +138,7 @@ export function DownloadsSettings() {
filenameLowercase,
filenameStripDiacritics,
filenameCollapseSeparators,
postExportAction,
updateSetting,
} = useSettingsStore();
@@ -249,6 +250,17 @@ export function DownloadsSettings() {
onChange={(checked) => updateSetting("filenameCollapseSeparators", checked)}
/>
</SettingItem>
<SettingItem label={t("after_export.label")} description={t("after_export.description")}>
<Select
value={postExportAction}
onChange={(value) => updateSetting("postExportAction", value as "keep" | "archive" | "trash")}
options={[
{ value: "keep", label: t("after_export.keep") },
{ value: "archive", label: t("after_export.archive") },
{ value: "trash", label: t("after_export.trash") },
]}
/>
</SettingItem>
</SettingsSection>
);
}