work around Electron dialog title bug

In previous versions of this app, Electron automaticaly put "Scratch"
in the title bar for these dialogs.

See https://github.com/electron/electron/issues/30223
This commit is contained in:
Christopher Willis-Ford 2021-11-10 07:04:29 -08:00
parent c5caa7acc5
commit 2ba74d7ac0

View file

@ -292,6 +292,7 @@ const createMainWindow = () => {
// don't clean up until after the message box to allow troubleshooting / recovery
await dialog.showMessageBox(window, {
type: 'error',
title: 'Failed to save project',
message: `Save failed:\n${userChosenPath}`,
detail: e.message
});
@ -312,6 +313,7 @@ const createMainWindow = () => {
webContents.on('will-prevent-unload', ev => {
const choice = dialog.showMessageBoxSync(window, {
title: productName,
type: 'question',
message: 'Leave Scratch?',
detail: 'Any unsaved changes will be lost.',