You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ipcMain.on("save-as", (event, data) => {
console.log("Save As: Main Process");
console.log(`Data: ${JSON.stringify(data)}`);
try {
console.log("Before Dialog");
const path = dialog.showSaveDialogSync({});
console.log("After Dialog");
if (path) {
console.log("Path selected");
console.log(`Path: ${path}`);
const fileBuffer = Buffer.from(data, "base64");
fs.writeFile(path, fileBuffer, (err) => {
if (err) {
console.log(err);
return;
}
});
} else {
console.log("No path selected");
}
} catch (error) {
console.log("Error in save-as");
console.log(error);
}
console.log("Save As in Main Process Done");
});
}
Result:
Save As: Main Process
Data: "NiaMTwAAAAAAABkBAAAAAAAAAAAEAAAAEAQAAAAICAAHQBwAAAgDoAwAAAQAEVGVzdAAACAdTaWduYWwxAAABAACAPwAAgD8AAAAAAAAAAAA="
Before Dialog
As you can see, nothing is happening after the dialog (I have tried both saving and canceling the dialog).
It does work if I convert everything to a async dialog.
Hello @saltyshiomix , and the Nextron Community:
The showSaveDialogSync seems not to be working.
Code example:
Result:
As you can see, nothing is happening after the dialog (I have tried both saving and canceling the dialog).
It does work if I convert everything to a async dialog.
Might it be related to this bug? electron/electron#31152
It is a very old bug though, the project is on Electron 31 right?
Thanks for your time and your work for the community @saltyshiomix .
EDIT: I have no idea what those links from those people are down below, but I highly recommend not clicking them. I have reported them to Github.
The text was updated successfully, but these errors were encountered: