Skip to content

Commit

Permalink
env: no reload confirmation in dev environment
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnaud Courtecuisse authored and arnaudcourtecuisse-imp committed May 2, 2024
1 parent 25c0ef6 commit 19d3259
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Controllers/ControlPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,13 @@ class ControlPanel {
}.bind(this));

window.onbeforeunload = function (e) {
e = e || window.event;
let return_str = 'this will cause a confirmation on page close'
if (process.env.NODE_ENV === "development") {
console.log("[dev] no page close confirmation");
return;
}
e = e ?? window.event;

const return_str = "this will cause a confirmation on page close";
if (e) {
e.returnValue = return_str;
}
Expand Down

0 comments on commit 19d3259

Please sign in to comment.