From b36c886068300974bdcc6933471cc72cb56c6e37 Mon Sep 17 00:00:00 2001 From: Matteo Gheza Date: Wed, 30 Aug 2023 12:51:52 +0200 Subject: [PATCH] Fix unused variable in app.component.ts --- frontend/src/app/_services/locationBack.service.ts | 4 +++- frontend/src/app/app.component.ts | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/_services/locationBack.service.ts b/frontend/src/app/_services/locationBack.service.ts index e3094bf..ace583e 100644 --- a/frontend/src/app/_services/locationBack.service.ts +++ b/frontend/src/app/_services/locationBack.service.ts @@ -8,7 +8,9 @@ import { Router, NavigationEnd } from '@angular/router' export class LocationBackService { private history: string[] = []; - constructor(private router: Router, private location: Location) { + constructor(private router: Router, private location: Location) { } + + initialize() { this.router.events.subscribe((event) => { if (event instanceof NavigationEnd && !event.urlAfterRedirects.includes('login')) { this.history.push(event.urlAfterRedirects); diff --git a/frontend/src/app/app.component.ts b/frontend/src/app/app.component.ts index 962c882..ecccb35 100644 --- a/frontend/src/app/app.component.ts +++ b/frontend/src/app/app.component.ts @@ -32,6 +32,7 @@ export class AppComponent { public guard: AuthorizeGuard ) { this.revision_datetime_string = new Date(versions.revision_timestamp).toLocaleString(undefined, { day: '2-digit', month: '2-digit', year: 'numeric', hour: 'numeric', minute: 'numeric', second: 'numeric' }); + this.locationBackService.initialize(); } loadAlerts() {