Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timeToIdle of 30 minutes not working #15

Open
nickpassarella opened this issue Feb 3, 2021 · 2 comments
Open

timeToIdle of 30 minutes not working #15

nickpassarella opened this issue Feb 3, 2021 · 2 comments

Comments

@nickpassarella
Copy link

nickpassarella commented Feb 3, 2021

Is there an upper limit of some kind to timetoIdle? I'm using this to implement an auto logout. In tests at one minute or less, it works great. But when I set timeToIdle to 1800000, it fires the idle callback after about 10 seconds.

@Rolando-Barbella
Copy link

I had the same issue when trying to make for 60 mins

@GreenPioneer
Copy link

GreenPioneer commented Apr 25, 2024

.... 3 Years later

For anyone else that ends up here like I did

The answer is in the init function

inactivityEvents.filter(eventName => eventName !== 'visibilitychange').forEach(eventName =>window.addEventListener(eventName, handleUserInactivityEvent));
if (inactivityEvents.indexOf('visibilitychange') >= 0 && visibilityChangeEvent) {document.addEventListener(visibilityChangeEvent, handleVisibilityChangeEvent);}

The init function has two types of extra listeners that no one realizes is there. These two listeners will run their call back, which can turn your timer to idle. In doing so, it looks like the timer doesn't work when that is not the case.

All you have to do is pass the settings to override the defaults for those two settings or copy and paste the code into your project and delete these specific lines in the init function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants