From 64a66537f10d79f3856cdabfb12ea0896aa0f48d Mon Sep 17 00:00:00 2001 From: Nakul Manchanda Date: Sun, 19 Apr 2020 13:37:59 -0400 Subject: [PATCH 1/2] moved last active to local storage Signed-off-by: Nakul Manchanda --- .../src/app/authentication-manager/login/login.component.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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..752668709 100644 --- a/virtual-desktop/src/app/authentication-manager/login/login.component.ts +++ b/virtual-desktop/src/app/authentication-manager/login/login.component.ts @@ -125,7 +125,8 @@ export class LoginComponent implements OnInit { } private isIdle(): boolean { - let idle = (Date.now() - this.lastActive) > ACTIVITY_IDLE_TIMEOUT_MS; + const lastActive = parseInt(window.localStorage.getItem('lastActive') || '0'); + let idle = (Date.now() - 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}`); 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('lastActive',this.lastActive.toString()); if (this.idleWarnModal) { this.popupManager.removeReport(this.idleWarnModal.id); this.idleWarnModal = undefined; From 4a846f4581e521f3c99d784027222aac9b18507d Mon Sep 17 00:00:00 2001 From: Nakul Manchanda Date: Mon, 20 Apr 2020 12:21:37 -0400 Subject: [PATCH 2/2] add prefix namespace Signed-off-by: Nakul Manchanda --- .../src/app/authentication-manager/login/login.component.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 752668709..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,9 +125,9 @@ export class LoginComponent implements OnInit { } private isIdle(): boolean { - const lastActive = parseInt(window.localStorage.getItem('lastActive') || '0'); + const lastActive = parseInt(window.localStorage.getItem('ZoweZLUX.lastActive') || '0'); let idle = (Date.now() - 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}`); + this.logger.debug("ZWED5304I", lastActive, Date.now(), idle); //this.logger.debug(`User lastActive=${lastActive}, now=${Date.now()}, idle={idle}`); return idle; } @@ -217,7 +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('lastActive',this.lastActive.toString()); + window.localStorage.setItem('ZoweZLUX.lastActive',this.lastActive.toString()); if (this.idleWarnModal) { this.popupManager.removeReport(this.idleWarnModal.id); this.idleWarnModal = undefined;