There was an error while loading. Please reload this page.
1 parent a4c1d18 commit 018f701Copy full SHA for 018f701
1 file changed
apps/desktop/src/main/index.ts
@@ -819,12 +819,15 @@ async function exportNotePdf(
819
}
820
821
const suggestedName = `${sanitizePdfFilename(noteTitleFromRelPath(relPath))}.pdf`
822
- const result = await dialog.showSaveDialog(parentWindow ?? undefined, {
+ const saveDialogOptions = {
823
title: 'Export Note as PDF',
824
defaultPath: path.join(app.getPath('documents'), suggestedName),
825
buttonLabel: 'Export PDF',
826
filters: [{ name: 'PDF', extensions: ['pdf'] }]
827
- })
+ }
828
+ const result = parentWindow
829
+ ? await dialog.showSaveDialog(parentWindow, saveDialogOptions)
830
+ : await dialog.showSaveDialog(saveDialogOptions)
831
if (result.canceled || !result.filePath) return null
832
833
const targetPath = ensurePdfExtension(result.filePath)
0 commit comments