X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fapp%2FAppComponent.ts;h=26d7aab6e36268df9eafb3cc31af05b10e7e10d6;hb=HEAD;hp=1c5886a953923bc7c8ca2d62a6dcd6e25be50aa9;hpb=5b35bcd21392dc71d3a847ba3a20e9fcd38534f6;p=osm%2FNG-UI.git diff --git a/src/app/AppComponent.ts b/src/app/AppComponent.ts index 1c5886a..0571014 100644 --- a/src/app/AppComponent.ts +++ b/src/app/AppComponent.ts @@ -19,13 +19,12 @@ /** * @file App Components */ -import { isNullOrUndefined } from 'util'; import { Component, HostListener, Injector } from '@angular/core'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { DEFAULT_INTERRUPTSOURCES, Idle } from '@ng-idle/core'; import { AuthenticationService } from 'AuthenticationService'; import { DeviceCheckService } from 'DeviceCheckService'; -import { SharedService } from 'SharedService'; +import { SharedService, isNullOrUndefined } from 'SharedService'; /** * Creating component @@ -38,6 +37,8 @@ import { SharedService } from 'SharedService'; }) /** Exporting a class @exports AppComponent */ export class AppComponent { + /** Handle idle time out @public */ + public idleTime: number; /** To inject services @public */ public injector: Injector; /** Instance for modal service @public */ @@ -70,10 +71,14 @@ export class AppComponent { /** To handle handleIdle @public */ public handleIdle(): void { - const idleTime: number = 1200; + if (!isNullOrUndefined((sessionStorage.getItem('timeout')))) { + this.idleTime = Number(sessionStorage.getItem('timeout')); + } else { + this.idleTime = 1200; + } const idleTimeOutWarning: number = 5; // sets an idle timeout in seconds. - this.idle.setIdle(idleTime); + this.idle.setIdle(this.idleTime); //sets a timeout period in seconds. after idleTime seconds of inactivity, the user will be considered timed out. this.idle.setTimeout(idleTimeOutWarning); // sets the default interrupts, in this case, things like clicks, scrolls, touches to the document