From a43d3040b776952a26c028a2e4a42268986c9048 Mon Sep 17 00:00:00 2001 From: PalmerAL Date: Mon, 1 Nov 2021 23:07:31 -0500 Subject: [PATCH] switch to async dialog API to work around electron/electron#31152 (#1780) fixes #1768 --- main/remoteActions.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/main/remoteActions.js b/main/remoteActions.js index a805e5c28..6eb380b37 100644 --- a/main/remoteActions.js +++ b/main/remoteActions.js @@ -37,12 +37,14 @@ ipc.handle('showFocusModeDialog2', function () { }) }) -ipc.handle('showOpenDialog', function (e, options) { - return dialog.showOpenDialogSync(mainWindow, options) +ipc.handle('showOpenDialog', async function (e, options) { + const result = await dialog.showOpenDialog(mainWindow, options) + return result.filePaths }) -ipc.handle('showSaveDialog', function (e, options) { - return dialog.showSaveDialogSync(mainWindow, options) +ipc.handle('showSaveDialog', async function (e, options) { + const result = await dialog.showSaveDialog(mainWindow, options) + return result.filePath }) ipc.handle('addWordToSpellCheckerDictionary', function (e, word) {