fix(webui): dispatch close events when closing popups (#7340)

* fix: dispatch `close` event in statistics dialogue

* fix: properly dispatch `close` event in pref dialogue
This commit is contained in:
Yat Ho
2024-12-29 15:39:56 +08:00
committed by GitHub
parent 7820f54ba1
commit 536fe4a6e1
2 changed files with 2 additions and 1 deletions

View File

@@ -856,7 +856,7 @@ export class PrefsDialog extends EventTarget {
this.update_from_session,
);
this.elements.root.remove();
dispatchEvent(new Event('close'));
this.dispatchEvent(new Event('close'));
for (const key of Object.keys(this)) {
this[key] = null;
}

View File

@@ -33,6 +33,7 @@ export class StatisticsDialog extends EventTarget {
if (!this.closed) {
clearInterval(this.interval);
this.elements.root.remove();
this.dispatchEvent(new Event('close'));
for (const key of Object.keys(this)) {
delete this[key];
}