feat(renderer): export dialogs toast on success/failure

This commit is contained in:
2026-06-05 23:05:32 +05:30
parent 338669f2db
commit b40bff641c
4 changed files with 12 additions and 0 deletions
@@ -7,6 +7,7 @@ import { useAppStore } from '@/stores/app-store';
import { useSettingsStore } from '@/stores/settings-store';
import { useExportSource } from '@/hooks/use-export-source';
import { ipc } from '@/lib/ipc';
import { toast } from '@/lib/toast';
import { ExportDialogFooter } from './ExportDialogFooter';
const MARGIN_MAP = {
@@ -44,9 +45,11 @@ export function ExportPdfDialog({ sourcePath }: { sourcePath: string }) {
fontSize,
} as any);
if (!result.data?.ok) {
toast.error(`Export failed: ${result.data?.error?.message ?? 'Export failed'}`);
setError(result.data?.error?.message ?? 'Export failed');
setSubmitting(false);
} else {
toast.success(`Exported ${source.title} to ${result.data?.outputPath ?? 'file'}`);
closeModal();
}
};