-
-
Notifications
You must be signed in to change notification settings - Fork 145
User turning screen off and returns later doesn't seem to trigger onIdle #344
-
Hello!
First of thanks a lot for the wonderful library.
I'm wondering whether this library is meant to track idle status on users that:
- Are active on web app
- Signs out of computer (i.e. closes laptop lid without signing out or closing tab/browser)
- Returns to web app many hours later
From what I've seen, this doesn't seem to be the case? I've had users saying that they've still been signed in to the app in the morning.
Appreciate any ideas of the best way of implementing this if not supported, thanks!
Beta Was this translation helpful? Give feedback.
All reactions
The timer should log you out if you have been idle longer than the timeout value, but it would require user input in order to trigger it. If we wanted something a little more robust we could use a timeout to incrementally check the last idle time against the current time, though I would have to measure the performance impacts. I will test it out for the next release. In the mean time it should be too hard to implement yourself using getLastActiveTime() and new Date().getTime():
if (+new Date() - idleTimer.getLastActiveTime() > props.timeout) { idleTimer.pause() onIdle() }
Replies: 1 comment 1 reply
-
The timer should log you out if you have been idle longer than the timeout value, but it would require user input in order to trigger it. If we wanted something a little more robust we could use a timeout to incrementally check the last idle time against the current time, though I would have to measure the performance impacts. I will test it out for the next release. In the mean time it should be too hard to implement yourself using getLastActiveTime() and new Date().getTime():
if (+new Date() - idleTimer.getLastActiveTime() > props.timeout) { idleTimer.pause() onIdle() }
Beta Was this translation helpful? Give feedback.
All reactions
-
I see, that'd be great. Thanks a lot!
Beta Was this translation helpful? Give feedback.