Fix player render tick and notification dark theme colors

pull/1163/head
voc0der 2 months ago
parent 79f0ca7a83
commit 4ba1858a1e

@ -19,6 +19,16 @@
.notification-card {
margin-top: 5px;
color: var(--mat-sidenav-container-text-color, inherit);
}
.notification-card .mat-mdc-card-title,
.notification-card .mat-mdc-card-subtitle,
.notification-card .mat-mdc-card-content,
.notification-card .mat-mdc-card-actions,
.notification-card .mat-icon,
.notification-card .mat-mdc-icon-button {
color: inherit !important;
}
.notification-actions {
@ -43,4 +53,4 @@
.viewport {
height: 100%;
}
}

@ -107,6 +107,18 @@ export class PlayerComponent implements OnInit, AfterViewInit, OnDestroy {
private cdr: ChangeDetectorRef) {
}
private refreshView(): void {
// Some async init paths can complete without an immediate UI tick.
setTimeout(() => {
try {
this.cdr.detectChanges();
} catch {
// Ignore if the view is already destroyed.
}
});
}
processConfig(): void {
this.baseStreamPath = this.postsService.path;
this.audioFolderPath = this.postsService.config['Downloader']['path-audio'];
@ -135,6 +147,7 @@ export class PlayerComponent implements OnInit, AfterViewInit, OnDestroy {
this.playlist.push(imedia);
this.updateCurrentItem(this.playlist[0], 0);
this.show_player = true;
this.refreshView();
}
}
@ -235,6 +248,7 @@ export class PlayerComponent implements OnInit, AfterViewInit, OnDestroy {
this.currentItem = this.playlist[this.currentIndex];
this.original_playlist = JSON.stringify(this.playlist);
this.show_player = true;
this.refreshView();
}
onPlayerReady(api: VgApiService): void {

Loading…
Cancel
Save