X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=src%2Fapp%2Flayouts%2Fheader%2FHeaderComponent.ts;h=45807f948dda2d69565275e6a29f4896b4ff88ec;hb=HEAD;hp=13e2129a209d2a14f84809e8c8bf85e209a03a90;hpb=5b35bcd21392dc71d3a847ba3a20e9fcd38534f6;p=osm%2FNG-UI.git diff --git a/src/app/layouts/header/HeaderComponent.ts b/src/app/layouts/header/HeaderComponent.ts index 13e2129..45807f9 100644 --- a/src/app/layouts/header/HeaderComponent.ts +++ b/src/app/layouts/header/HeaderComponent.ts @@ -28,7 +28,7 @@ import { MODALCLOSERESPONSEDATA } from 'CommonModel'; import { environment } from 'environment'; import { ProjectService } from 'ProjectService'; import { Observable } from 'rxjs'; -import { SharedService } from 'SharedService'; +import { SharedService, isNullOrUndefined } from 'SharedService'; import { UserSettingsComponent } from 'UserSettingsComponent'; /** @@ -75,6 +75,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 +104,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(); } }