From a9405dc535981bbe6c201533f5cbe4879c9cc4ab Mon Sep 17 00:00:00 2001 From: Jonas Hvid Date: Sun, 12 Dec 2021 22:33:36 +0100 Subject: [PATCH] Work around bug in `showSaveDialogSync` on Linux See https://github.com/electron/electron/issues/31152. --- src/desktop/start.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/desktop/start.tsx b/src/desktop/start.tsx index 14ae32f7..81f7ed06 100644 --- a/src/desktop/start.tsx +++ b/src/desktop/start.tsx @@ -13,11 +13,13 @@ Electron.app.whenReady().then(async () => { window.setMenu(null); - Electron.ipcMain.handle("open-file", () => { - return Electron.dialog.showSaveDialogSync(window, { - title: "Open or Create File", - buttonLabel: "Open", - }); + Electron.ipcMain.handle("open-file", async () => { + return ( + await Electron.dialog.showSaveDialog(window, { + title: "Open or Create File", + buttonLabel: "Open", + }) + ).filePath; }); // [TODO] We need to do build/whatever only when using electron-builder for