From 63c25053569641af80e41a05c16261587a8feccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Renaudeau?= Date: Thu, 3 Jan 2019 11:19:26 +0100 Subject: [PATCH] Bugfixes autolock Idler --- src/components/Idler.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/Idler.js b/src/components/Idler.js index 392f5e77..7029d79f 100644 --- a/src/components/Idler.js +++ b/src/components/Idler.js @@ -40,6 +40,10 @@ class Idler extends PureComponent { lastAction: number = -1 + idleTimeHandler = () => { + this.lastAction = Date.now() + } + debounceOnChange = debounce(this.idleTimeHandler, 1000, { maxWait: 1000, leading: true }) checkForAutoLock = _ => { @@ -51,10 +55,6 @@ class Idler extends PureComponent { } } - idleTimeHandler = _ => { - this.lastAction = Date.now() - } - render() { return null }