diff --git a/esp/src/src/ESPUtil.ts b/esp/src/src/ESPUtil.ts index 43cf058435d..410c1e1e5a6 100644 --- a/esp/src/src/ESPUtil.ts +++ b/esp/src/src/ESPUtil.ts @@ -333,20 +333,22 @@ export const IdleWatcher = dojo.declare([Evented], { start() { this.stop(); - const context = this; - this._keydownHandle = on(document, "keydown", function (item, index, array) { - context.emit("active", {}); - context.stop(); - context.start(); - }); - this._mousedownHandle = on(document, "mousedown", function (item, index, array) { - context.emit("active", {}); - context.stop(); - context.start(); - }); - this._intervalHandle = setInterval(function () { - context.emit("idle", {}); - }, this._idleDuration); + if (document.cookie.indexOf("ESPSessionState=true") > -1) { + const context = this; + this._keydownHandle = on(document, "keydown", function (item, index, array) { + context.emit("active", {}); + context.stop(); + context.start(); + }); + this._mousedownHandle = on(document, "mousedown", function (item, index, array) { + context.emit("active", {}); + context.stop(); + context.start(); + }); + this._intervalHandle = setInterval(function () { + context.emit("idle", {}); + }, this._idleDuration); + } }, stop() {