diff --git a/src/ui/modal/ModalRenderer.ts b/src/ui/modal/ModalRenderer.ts index 7e6bc9f..28be772 100644 --- a/src/ui/modal/ModalRenderer.ts +++ b/src/ui/modal/ModalRenderer.ts @@ -154,7 +154,20 @@ export class ModalRenderer { text: 'Export', cls: 'mod-cta' }); - this.submitButton.addEventListener('click', () => void this.callbacks.onSubmit()); + this.submitButton.addEventListener('click', () => { + this.setExportingState(true); + Promise.resolve(this.callbacks.onSubmit()).catch(err => { + // Log the error for debugging + console.error('Export submission failed:', err); + + // Show user-facing error feedback + const errorMessage = err instanceof Error ? err.message : 'An unknown error occurred during export'; + this.showValidationErrors([errorMessage]); + + // Re-enable buttons so user can try again or cancel + this.setExportingState(false); + }); + }); } /** diff --git a/src/ui/modal/sections/GeneralSection.ts b/src/ui/modal/sections/GeneralSection.ts index 4a9c11e..929b790 100644 --- a/src/ui/modal/sections/GeneralSection.ts +++ b/src/ui/modal/sections/GeneralSection.ts @@ -75,7 +75,7 @@ export class GeneralSection implements ModalSection { new Setting(this.container) .setName('Output folder') - .setDesc('Location for exported PDF files (relative to vault root)') + .setDesc('Location for exported PDF files (relative to vault root or absolute path)') .addText(text => { const input = text .setPlaceholder('PDF exports')