Skip to content

A local-first personal finance app

:electron: Fix "Export" function on desktop app (#2925)

Michael Clark48f5880f1dc2
diff --git a/packages/desktop-electron/index.js b/packages/desktop-electron/index.js
index 909a0cc7f8..f3b2fca55a 100644
--- a/packages/desktop-electron/index.js
+++ b/packages/desktop-electron/index.js
@@ -309,12 +309,12 @@ ipcMain.handle('open-file-dialog', (event, { filters, properties }) => {
ipcMain.handle(
'save-file-dialog',
- (event, { title, defaultPath, fileContents }) => {
- const fileLocation = dialog.showSaveDialogSync({ title, defaultPath });
+ async (event, { title, defaultPath, fileContents }) => {
+ const fileLocation = await dialog.showSaveDialog({ title, defaultPath });
return new Promise((resolve, reject) => {
if (fileLocation) {
- fs.writeFile(fileLocation, fileContents, error => {
+ fs.writeFile(fileLocation.filePath, fileContents, error => {
return reject(error);
});
}
diff --git a/upcoming-release-notes/2925.md b/upcoming-release-notes/2925.md
new file mode 100644
index 0000000000..f588b238bd
--- /dev/null
+++ b/upcoming-release-notes/2925.md
@@ -0,0 +1,6 @@
+---
+category: Bugfix
+authors: [MikesGlitch]
+---
+
+Fixes "Export data" not saving the file in Electron app on Linux