diff --git a/client/js/socket-events/configuration.js b/client/js/socket-events/configuration.js index 9c3e4eec..72b58f86 100644 --- a/client/js/socket-events/configuration.js +++ b/client/js/socket-events/configuration.js @@ -26,9 +26,9 @@ socket.once("configuration", function(data) { } if (document.body.classList.contains("public")) { - window.addEventListener( - "beforeunload", - () => "Are you sure you want to navigate away from this page?" - ); + window.addEventListener("beforeunload", (e) => { + e.preventDefault(); + e.returnValue = "Are you sure you want to navigate away from this page?"; + }); } });