From 9c3269c6dd4263d39945e13e312fca8cb314d5cb Mon Sep 17 00:00:00 2001 From: Juan Cortes Ross Date: Mon, 24 Dec 2018 00:21:41 +0100 Subject: [PATCH] Added the leading option too --- src/components/Idler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Idler.js b/src/components/Idler.js index 8132eb28..6aa1f559 100644 --- a/src/components/Idler.js +++ b/src/components/Idler.js @@ -40,7 +40,7 @@ class Idler extends PureComponent { lastAction: number = -1 - debounceOnChange = debounce(_ => this.idleTimeHandler(), 1000, { maxWait: 1000 }) + debounceOnChange = debounce(_ => this.idleTimeHandler(), 1000, { maxWait: 1000, leading: true }) checkForAutoLock = _ => { const timeout = this.props.autoLockTimeout