Skip to content

Commit

Permalink
Fix for reloading developer tools, since dialog.showMessageBox now re…
Browse files Browse the repository at this point in the history
…turns a Promise
  • Loading branch information
joethephish committed May 15, 2024
1 parent b9a3dd1 commit fdd5bc1
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions app/main-process/appmenus.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,15 +373,18 @@ function refresh() {
accelerator: 'CmdOrCtrl+R',
click(item, focusedWindow) {
if (!focusedWindow) return;
var clickedButtonIdx = dialog.showMessageBox(focusedWindow, {
dialog.showMessageBox(focusedWindow, {
type: 'question',
buttons: [i18n._('Yes'), i18n._('Cancel')],
title: i18n._('Reload?'),
message: i18n._('Are you sure you want to reload the current window? Any unsaved changes will be lost.')
});
if( clickedButtonIdx == 0 ) {
focusedWindow.reload();
}
}).then(result => {
let clickedOkay = result.response == 0;
if( clickedOkay ) {
focusedWindow.reload();
}
})

}
},
{
Expand Down

0 comments on commit fdd5bc1

Please sign in to comment.