Skip to content

Commit

Permalink
switch to async dialog API to work around electron/electron#31152 (#1780
Browse files Browse the repository at this point in the history
)

fixes #1768
  • Loading branch information
PalmerAL committed Nov 2, 2021
1 parent a9fd6a5 commit a43d304
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions main/remoteActions.js
Expand Up @@ -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) {
Expand Down

0 comments on commit a43d304

Please sign in to comment.