Skip to content

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

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

You must be logged in to vote
1 reply
@pimmee
Comment options

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
2 participants