This commit is contained in:
2026-03-15 12:50:33 +01:00
parent dd68a6b21d
commit d907c89eb6
36 changed files with 309 additions and 286 deletions

View File

@@ -43,6 +43,7 @@ export class MonitorComponent implements OnInit, OnDestroy {
public config$: Observable<Config | null>;
public presentationBackground: PresentationBackground = 'none';
private destroy$ = new Subject<void>();
private songSwitchTimeoutId: ReturnType<typeof setTimeout> | null = null;
public constructor() {
const configService = this.configService;
@@ -97,7 +98,10 @@ export class MonitorComponent implements OnInit, OnDestroy {
if (this.songId !== presentationSongId) {
this.songId = 'empty';
}
setTimeout(() => {
if (this.songSwitchTimeoutId) {
clearTimeout(this.songSwitchTimeoutId);
}
this.songSwitchTimeoutId = setTimeout(() => {
this.songId = presentationSongId;
this.cRef.markForCheck();
}, 600);
@@ -113,6 +117,9 @@ export class MonitorComponent implements OnInit, OnDestroy {
}
public ngOnDestroy(): void {
if (this.songSwitchTimeoutId) {
clearTimeout(this.songSwitchTimeoutId);
}
this.destroy$.next();
this.destroy$.complete();
}