mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-27 12:17:24 +00:00
Add warning on page unload if uploads are in progress
This commit is contained in:
@@ -188,3 +188,10 @@ class UploadingManager extends Listenable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const uploadingManager = new UploadingManager();
|
export const uploadingManager = new UploadingManager();
|
||||||
|
|
||||||
|
window.addEventListener("beforeunload", () => {
|
||||||
|
if (uploadingManager.hasTasks()) {
|
||||||
|
return "Uploading files, are you sure you want to leave?";
|
||||||
|
}
|
||||||
|
return undefined;
|
||||||
|
})
|
Reference in New Issue
Block a user