Skip to content

Commit 018f701

Browse files
committed
Fix desktop PDF export save dialog typing
1 parent a4c1d18 commit 018f701

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

apps/desktop/src/main/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -819,12 +819,15 @@ async function exportNotePdf(
819819
}
820820

821821
const suggestedName = `${sanitizePdfFilename(noteTitleFromRelPath(relPath))}.pdf`
822-
const result = await dialog.showSaveDialog(parentWindow ?? undefined, {
822+
const saveDialogOptions = {
823823
title: 'Export Note as PDF',
824824
defaultPath: path.join(app.getPath('documents'), suggestedName),
825825
buttonLabel: 'Export PDF',
826826
filters: [{ name: 'PDF', extensions: ['pdf'] }]
827-
})
827+
}
828+
const result = parentWindow
829+
? await dialog.showSaveDialog(parentWindow, saveDialogOptions)
830+
: await dialog.showSaveDialog(saveDialogOptions)
828831
if (result.canceled || !result.filePath) return null
829832

830833
const targetPath = ensurePdfExtension(result.filePath)

0 commit comments

Comments
 (0)