From ac8a841e40d0e9d290877b1fe71a0f9456758fa5 Mon Sep 17 00:00:00 2001 From: falc <76709589+falcolnic@users.noreply.github.com> Date: Sat, 2 Aug 2025 08:36:22 +0300 Subject: [PATCH] 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 image --- src/client/index.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/client/index.html b/src/client/index.html index c18e82c52..a5ef0a1a9 100644 --- a/src/client/index.html +++ b/src/client/index.html @@ -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?"; + });