mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-27 04:17:23 +00:00
Add warning on page unload if uploads are in progress
This commit is contained in:
@@ -187,4 +187,11 @@ 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