diff --git a/src/app/pages/aviso/aviso.page.ts b/src/app/pages/aviso/aviso.page.ts index 1b7212a..dc9b016 100644 --- a/src/app/pages/aviso/aviso.page.ts +++ b/src/app/pages/aviso/aviso.page.ts @@ -6,7 +6,8 @@ import { ChangeDetectorRef, HostBinding, AfterViewInit, - Renderer2 + Renderer2, + NgZone } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; @@ -34,6 +35,7 @@ interface CssVariables { tileRowGapinPercent: string; flaggeLeft: string; flaggeBottom: string; + reload: string; } const TVTEXTSETTINGS_INTERVAL_MS = 60000; @@ -117,7 +119,7 @@ export class AvisoPage implements OnInit, OnDestroy, AfterViewInit { private toggleDivInterval: any; private currentCssVariables: CssVariables | null = null; - // NEU: Für den globalen Wechseltext + public toggleWechselText: boolean = false; private GLOBAL_WECHSELTEXT_INTERVAL: any; @@ -140,7 +142,8 @@ export class AvisoPage implements OnInit, OnDestroy, AfterViewInit { private avisoService: AvisoService, private cdr: ChangeDetectorRef, private sanitizer: DomSanitizer, - private renderer: Renderer2 + private renderer: Renderer2, + private ngZone: NgZone ) { } private convertToPx(fontSize: string): number { @@ -219,7 +222,7 @@ export class AvisoPage implements OnInit, OnDestroy, AfterViewInit { }); // TV Settings laden - interval(TVSETTINGS_INTERVAL_MS) + interval((this.avisoTvSettings[0]?.seitenwechselInSek * 1000 - 1000) || TVSETTINGS_INTERVAL_MS) .pipe( switchMap(() => this.loadAvisoTvSettings()), takeUntil(this.destroy$) @@ -405,6 +408,7 @@ export class AvisoPage implements OnInit, OnDestroy, AfterViewInit { tileRowGapinPercent: `${settings.kachelRowGapInPercent}px`, flaggeLeft: `${settings.flaggeLeft}vw`, flaggeBottom: `${settings.flaggeBottom}vh`, + reload: `${settings.reload}`, }; if (this.currentCssVariables && this.hasCssVariablesChanged(newCssVariables)) { @@ -700,22 +704,27 @@ export class AvisoPage implements OnInit, OnDestroy, AfterViewInit { if (!aviso || !aviso.avisoTVHinweis) { return; } - // "true" => normaler Inhalt, "false" => Hinweis - if (this.avisoStates[key]) { + + if (this.avisoStates[key]) { this.avisoTimeouts[key] = setTimeout(() => { - this.avisoStates[key] = false; - this.startAvisoCycle(key); - this.cdr.detectChanges(); + this.ngZone.run(() => { + this.avisoStates[key] = false; + this.startAvisoCycle(key); + this.cdr.detectChanges(); + }); }, this.contentDuration); } else { this.avisoTimeouts[key] = setTimeout(() => { - this.avisoStates[key] = true; - this.startAvisoCycle(key); - this.cdr.detectChanges(); + this.ngZone.run(() => { + this.avisoStates[key] = true; + this.startAvisoCycle(key); + this.cdr.detectChanges(); + }); }, this.avisoHinweisDuration); } } + private findAvisoByKey(key: string): AvisoDto | undefined { for (const page of this.pages) { for (const aviso of page) { diff --git a/src/app/services/aviso.dto.ts b/src/app/services/aviso.dto.ts index 222188d..c1b35c6 100644 --- a/src/app/services/aviso.dto.ts +++ b/src/app/services/aviso.dto.ts @@ -29,6 +29,7 @@ export interface TvSettings { logo: string; flaggeLeft: string; flaggeBottom: string; + reload: boolean; } export interface AvisoTvTextSettingsDto { diff --git a/src/index.html b/src/index.html index 448088f..ec481f0 100644 --- a/src/index.html +++ b/src/index.html @@ -3,7 +3,7 @@ - Ionic App + VERAG AG TV-APP