Skip to content

Commit

Permalink
fix(firefox): 🐛 fix unsaved confirmation dialogue display
Browse files Browse the repository at this point in the history
was displaying confirmation even if no unsaved changes
  • Loading branch information
JamesNZL committed Jul 16, 2022
1 parent 79a498b commit 847ca95
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/options/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,10 @@ document.addEventListener('DOMContentLoaded', async () => {
*/

window.addEventListener('beforeunload', event => {
event.preventDefault();
if (buttons.restore.undo.isHidden()) return;

return (buttons.restore.undo.isHidden())
? null
: event.returnValue = 'Changes you made may not be saved.';
event.preventDefault();
return event.returnValue = 'Changes you made may not be saved.';
});

/*
Expand Down

0 comments on commit 847ca95

Please sign in to comment.