grbsk / ng-idle

Responding to idle users in AngularJS applications.
http://hackedbychinese.github.io/ng-idle
MIT License
564 stars 195 forks source link

Not want to reset timer in case of user intervention in app #215

Closed KinjalAkhani closed 6 years ago

KinjalAkhani commented 6 years ago

Hello,

Using ng-idle we are able to detect user idleness but in my case i dont want to reset timer in case of user intervention in app.

If condition match to reset timer for example in case of service call to server then only idle watch timer reset.

So how can i do that using ng-idle. Is it possible ?

KinjalAkhani commented 6 years ago

I found answer of this question. To stop resting timer in case of user intervention we just need to add below line in config function:

IdleProvider.interrupt('');

interrupt function takes string as parameter and we have to specify user interrupts events like onscroll, resume, etc. So by call the function with blank value resolved this issue.