Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

User turning screen off and returns later doesn't seem to trigger onIdle #344

Answered by SupremeTechnopriest
pimmee asked this question in Q&A
Discussion options

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:

  1. Are active on web app
  2. Signs out of computer (i.e. closes laptop lid without signing out or closing tab/browser)
  3. 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!

You must be logged in to vote

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

Comment options

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()
}
You must be logged in to vote
1 reply
Comment options

I see, that'd be great. Thanks a lot!

Answer selected by pimmee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /