X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fapp%2Flayouts%2Fheader%2FHeaderComponent.ts;fp=src%2Fapp%2Flayouts%2Fheader%2FHeaderComponent.ts;h=fa932b87fd5fd4c3561960ff9150fe8f429e82a8;hb=995c6728dfcd126c3e6f1febaf9a3399803153d1;hp=13e2129a209d2a14f84809e8c8bf85e209a03a90;hpb=219fe61b3f8d15284ae3b36a133c2b34d3b444fc;p=osm%2FNG-UI.git diff --git a/src/app/layouts/header/HeaderComponent.ts b/src/app/layouts/header/HeaderComponent.ts index 13e2129..fa932b8 100644 --- a/src/app/layouts/header/HeaderComponent.ts +++ b/src/app/layouts/header/HeaderComponent.ts @@ -19,6 +19,7 @@ /** * @file Header Component */ +import { isNullOrUndefined } from 'util'; import { Component, Injector, OnInit } from '@angular/core'; import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; import { TranslateService } from '@ngx-translate/core'; @@ -75,6 +76,9 @@ export class HeaderComponent implements OnInit { /** handle translate @public */ public translateService: TranslateService; + /** Version holds version @public */ + public getLocalStorageVersion: string; + /** Utilizes auth service for any auth operations @private */ private authService: AuthenticationService; @@ -101,14 +105,19 @@ export class HeaderComponent implements OnInit { this.authService.ProjectName.subscribe((projectNameFinal: string): void => { this.getSelectedProject = projectNameFinal; }); + this.sharedService.fetchOSMVersion(); this.username$ = this.authService.username; this.projectService.setHeaderProjects(); this.projectList$ = this.projectService.projectList; this.PACKAGEVERSION = environment.packageVersion; - const getLocalStorageVersion: string = sessionStorage.getItem('osmVersion'); - if (getLocalStorageVersion === null) { + if (!isNullOrUndefined(sessionStorage.getItem('version'))) { + this.getLocalStorageVersion = sessionStorage.getItem('version'); + } else if (!isNullOrUndefined(this.sharedService.osmVersion)) { + this.getLocalStorageVersion = this.sharedService.osmVersion; + } + if (this.getLocalStorageVersion === null) { this.showNewVersion(); - } else if (getLocalStorageVersion !== this.sharedService.osmVersion) { + } else if (this.getLocalStorageVersion !== sessionStorage.getItem('osmVersion')) { this.showNewVersion(); } }