diff --git a/virtual-desktop/src/app/authentication-manager/login/login.component.ts b/virtual-desktop/src/app/authentication-manager/login/login.component.ts index 6132e8685..5e5aac103 100644 --- a/virtual-desktop/src/app/authentication-manager/login/login.component.ts +++ b/virtual-desktop/src/app/authentication-manager/login/login.component.ts @@ -125,8 +125,9 @@ export class LoginComponent implements OnInit { } private isIdle(): boolean { - let idle = (Date.now() - this.lastActive) > ACTIVITY_IDLE_TIMEOUT_MS; - this.logger.debug("ZWED5304I", this.lastActive, Date.now(), idle); //this.logger.debug(`User lastActive=${this.lastActive}, now=${Date.now()}, idle={idle}`); + const lastActive = parseInt(window.localStorage.getItem('ZoweZLUX.lastActive') || '0'); + let idle = (Date.now() - lastActive) > ACTIVITY_IDLE_TIMEOUT_MS; + this.logger.debug("ZWED5304I", lastActive, Date.now(), idle); //this.logger.debug(`User lastActive=${lastActive}, now=${Date.now()}, idle={idle}`); return idle; } @@ -216,6 +217,7 @@ export class LoginComponent implements OnInit { detectActivity(): void { this.logger.debug('ZWED5305I'); //this.logger.debug('User activity detected'); this.lastActive = Date.now(); + window.localStorage.setItem('ZoweZLUX.lastActive',this.lastActive.toString()); if (this.idleWarnModal) { this.popupManager.removeReport(this.idleWarnModal.id); this.idleWarnModal = undefined;