linting
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -120,9 +120,11 @@ export class RemoteComponent implements OnDestroy {
|
||||
});
|
||||
|
||||
this.presentationDynamicCaptionChanged$
|
||||
.pipe(debounceTime(1000))
|
||||
.pipe(debounceTime(1000), takeUntil(this.destroy$))
|
||||
.subscribe(_ => void this.showService.update$(_.showId, {presentationDynamicCaption: _.presentationDynamicCaption}));
|
||||
this.presentationDynamicTextChanged$.pipe(debounceTime(1000)).subscribe(_ => void this.showService.update$(_.showId, {presentationDynamicText: _.presentationDynamicText}));
|
||||
this.presentationDynamicTextChanged$
|
||||
.pipe(debounceTime(1000), takeUntil(this.destroy$))
|
||||
.subscribe(_ => void this.showService.update$(_.showId, {presentationDynamicText: _.presentationDynamicText}));
|
||||
}
|
||||
|
||||
public trackBy(index: number, item: PresentationSong): string {
|
||||
|
||||
Reference in New Issue
Block a user