mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-22 13:39:46 +00:00
feature/prevent-from-accident-reloading (#1411)
## Description: Added prevention from accident reload of page ## Please complete the following: - [x] I have added screenshots for all UI updates - [ ] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [x] I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors ## Please put your Discord username so you can be contacted if a bug or regression is found: @qqkedsi <img width="526" height="896" alt="image" src="https://github.com/user-attachments/assets/22b273a5-de50-4567-93f0-353cea36ea29" />
This commit is contained in:
@@ -413,6 +413,10 @@
|
||||
document.documentElement.classList.remove("preload");
|
||||
});
|
||||
});
|
||||
window.addEventListener("beforeunload", function (e) {
|
||||
e.preventDefault();
|
||||
e.returnValue = "Are you sure you want to leave?";
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- Playwire ads -->
|
||||
|
||||
Reference in New Issue
Block a user