/**
* @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';
/** handle translate @public */
public translateService: TranslateService;
+ /** Version holds version @public */
+ public getLocalStorageVersion: string;
+
/** Utilizes auth service for any auth operations @private */
private authService: AuthenticationService;
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();
}
}
this.changePassword.next(false);
const langCode: string = sessionStorage.getItem('languageCode');
const redirecturl: string = isNullOrUndefined(sessionStorage.getItem('returnUrl')) ? '/' : sessionStorage.getItem('returnUrl');
- const osmVersion: string = isNullOrUndefined(sessionStorage.getItem('osmVersion')) ? '' : sessionStorage.getItem('osmVersion');
+ const osmVersion: string = isNullOrUndefined(sessionStorage.getItem('version')) ? '' : sessionStorage.getItem('version');
sessionStorage.clear();
sessionStorage.setItem('languageCode', langCode);
sessionStorage.setItem('returnUrl', redirecturl);