Check if the webui is reloading or being manually closed

Check for the Reloading... text
pull/1/head
Adrien 2023-08-21 03:23:42 +02:00 committed by GitHub
parent 6ea33f4a06
commit 62e01aa48a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -1,3 +1,7 @@
window.addEventListener('beforeunload', (event) => {
event.returnValue = 'Are you sure you want to leave Webui?';
});
if (document.body.innerHTML.includes('Reloading...')) {
return;
}
event.returnValue = 'Are you sure you want to leave Webui?';
});