Fix Stats button in Stream menu not updating state

This commit is contained in:
redphx
2024-10-06 20:01:53 +07:00
parent fd1494ebfa
commit 59a178bb16
2 changed files with 5 additions and 5 deletions

View File

@@ -89,7 +89,7 @@ export class StreamStats {
this.intervalId = window.setInterval(this.update.bind(this), this.REFRESH_INTERVAL);
}
stop(glancing=false) {
async stop(glancing=false) {
if (glancing && !this.isGlancing()) {
return;
}
@@ -101,11 +101,11 @@ export class StreamStats {
this.$container.classList.add('bx-gone');
}
toggle() {
async toggle() {
if (this.isGlancing()) {
this.$container && (this.$container.dataset.display = 'fixed');
} else {
this.isHidden() ? this.start() : this.stop();
this.isHidden() ? await this.start() : await this.stop();
}
}