From 289b32c169a985805b66faca6e01504879403f88 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Mon, 8 Jul 2019 19:49:55 -0600 Subject: [PATCH] Allow idle monitor to be disabled --- WHATSNEW.md | 1 + core/client.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/WHATSNEW.md b/WHATSNEW.md index 53dc54cb..be707a09 100644 --- a/WHATSNEW.md +++ b/WHATSNEW.md @@ -27,6 +27,7 @@ This document attempts to track **major** changes and additions in ENiGMA½. For ] } ``` +* `idleLogoutSeconds` and `preAuthIdleLogoutSeconds` can now be set to `0` to fully disable the idle monitor. ## 0.0.9-alpha * Development is now against Node.js 10.x LTS. While other Node.js series may continue to work, you're own your own and YMMV! diff --git a/core/client.js b/core/client.js index b044bcdf..566aec5d 100644 --- a/core/client.js +++ b/core/client.js @@ -476,7 +476,7 @@ Client.prototype.startIdleMonitor = function() { // use override value if set idleLogoutSeconds = this.idleLogoutSecondsOverride || idleLogoutSeconds; - if(nowMs - this.lastKeyPressMs >= (idleLogoutSeconds * 1000)) { + if(idleLogoutSeconds > 0 && (nowMs - this.lastKeyPressMs >= (idleLogoutSeconds * 1000))) { this.emit('idle timeout'); } }, 1000 * 60);