File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3939 }
4040 </ span >
4141 < span class ="line-of-site-icon ">
42- @if (isDarkMode) {
42+ @if (isDarkMode$ | async ) {
4343 < img
4444 ngSrc ="assets/satellite-graphics/sat-1-dark.png "
4545 [class.flip-icon] ="flightDesc "
Original file line number Diff line number Diff line change 11import { Component , OnInit , OnDestroy , inject } from '@angular/core' ;
22import { SubSink } from 'subsink' ;
3+ import { map } from 'rxjs/operators' ;
34
45import { Store } from '@ngrx/store' ;
56import { AppState } from '@store' ;
@@ -38,7 +39,7 @@ export class TimeseriesHeaderComponent implements OnInit, OnDestroy {
3839 private themingService = inject ( ThemingService ) ;
3940
4041 public breakpoint$ = this . screenSize . breakpoint$ ;
41- public isDarkMode = false ;
42+ public isDarkMode$ = this . themingService . theme$ . pipe ( map ( theme => theme === 'dark' ) ) ;
4243 public breakpoints = models . Breakpoints ;
4344 public isDrawing = false ;
4445 public flightDirections : models . FlightDirection [ ] ;
@@ -47,12 +48,6 @@ export class TimeseriesHeaderComponent implements OnInit, OnDestroy {
4748 private subs = new SubSink ( ) ;
4849
4950 ngOnInit ( ) {
50- this . subs . add (
51- this . themingService . theme$ . subscribe ( theme => {
52- this . isDarkMode = theme === 'dark' ;
53- } ) ,
54- ) ;
55-
5651 this . flightDesc = false ;
5752 this . subs . add (
5853 this . store$
You can’t perform that action at this time.
0 commit comments