prompt before closing tab mid-upload

This commit is contained in:
xenofem 2022-05-24 23:55:20 -04:00
parent b2ee4ff7a8
commit 4276189595

View file

@ -29,6 +29,12 @@ let progressRate;
let progressEta; let progressEta;
let progressBar; let progressBar;
window.addEventListener('beforeunload', (event) => {
if (socket && socket.readyState !== 3) {
event.returnValue = "Upload is still in progress!";
}
});
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
document.body.className = 'landing'; document.body.className = 'landing';