diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 7a5de3c72..cbfd5b185 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit, OnDestroy, AfterViewInit, ViewChild, Inject } from '@angular/core'; +import { Component, OnInit, OnDestroy, AfterViewInit, ViewChild, Inject, HostListener } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; import { MatSidenav } from '@angular/material/sidenav'; import { MatIconRegistry } from '@angular/material/icon'; @@ -67,6 +67,8 @@ export class AppComponent implements OnInit, OnDestroy, AfterViewInit { public interactionTypes = models.MapInteractionModeType; public searchType: models.SearchType; + public kioskMode = false; + private helpTopic: string | null; private subs = new SubSink(); @@ -98,8 +100,14 @@ export class AppComponent implements OnInit, OnDestroy, AfterViewInit { private titleService: Title, @Inject(MAT_DATE_LOCALE) public _locale: string, ) { } - + + @HostListener('window:keydown.control./', ['$event']) + handleKeyDown(_event: KeyboardEvent) { + console.log('Toggling kiosk mode. Use "ctrl+/" to re-toggle') + this.store$.dispatch(new searchStore.setSearchKioskMode(!this.kioskMode)) + } public ngOnInit(): void { + console.log('To toggle kiosk mode, use "ctrl+/"') this.store$.dispatch(new hyp3Store.LoadCosts()); this.subs.add( @@ -125,6 +133,9 @@ export class AppComponent implements OnInit, OnDestroy, AfterViewInit { ) ); + this.subs.add( + this.store$.select(searchStore.getKioskMode).subscribe(kioskMode => this.kioskMode = kioskMode) + ) this.subs.add( this.store$.select(uiStore.getHelpDialogTopic).subscribe(topic => { const previousTopic = this.helpTopic; diff --git a/src/app/components/timeseries-chart/timeseries-chart.component.ts b/src/app/components/timeseries-chart/timeseries-chart.component.ts index 82272fbb5..1f921159b 100644 --- a/src/app/components/timeseries-chart/timeseries-chart.component.ts +++ b/src/app/components/timeseries-chart/timeseries-chart.component.ts @@ -230,7 +230,7 @@ export class TimeseriesChartComponent implements OnInit, OnDestroy { this.timeSeriesData = []; for (let key of Object.keys(result.point).filter(x => x !== 'mean' && x !== 'aoi')) { let daDate = new Date(result.point[key].secondary_datetime).valueOf(); - if (daDate < this.startDate.valueOf() || daDate > this.endDate.valueOf()) { continue; } + if (daDate < this.startDate?.valueOf() || daDate > this.endDate?.valueOf()) { continue; } this.dataSource.push({ 'aoi': aoi, 'short_wavelength_displacement': result.point[key].short_wavelength_displacement,