mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-28 00:12:25 +00:00
Ensure upload modal events rebind after reload
This commit is contained in:
1 parent
812194342c
commit
6c73ebda08
1 file changed
+9
-1
@@ -143,7 +143,11 @@ export class UploadModal {
|
||||
|
||||
async load({ container } = {}) {
|
||||
if (this.root) {
|
||||
return this.root;
|
||||
if (this.root.isConnected) {
|
||||
return this.root;
|
||||
}
|
||||
this.root = null;
|
||||
this.eventsBound = false;
|
||||
}
|
||||
|
||||
if (this.loadPromise) {
|
||||
@@ -192,8 +196,12 @@ export class UploadModal {
|
||||
throw new Error("Upload modal markup missing after load.");
|
||||
}
|
||||
|
||||
const previousRoot = this.root;
|
||||
this.container = targetContainer;
|
||||
this.root = modal;
|
||||
if (previousRoot && previousRoot !== modal) {
|
||||
this.eventsBound = false;
|
||||
}
|
||||
|
||||
this.cacheElements(modal);
|
||||
this.setupModalAccessibility();
|
||||
|
||||
Reference in new issue
Block a user