ng2-idle
ng2-idle copied to clipboard
NG Idle pauses if computer goes to sleep mode?
I'm submitting a ... (check one with "x")
[X] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/HackedByChinese/ng2-idle/blob/master/CONTRIBUTING.md#getting-help
Current behavior If I have a page opened and the countdown starts and I put my laptop to sleep, when I turn on my laptop again I am able to resume. Is this expected? Just want to check if I have implemented it correctly. Thank you!
Expected behavior
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
Please tell us about your environment:
- @ng-idle version: 2.x
- Angular version: 2.x
- Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
-
Language: [all | TypeScript X.X | ES6/7 | ES5]
-
Node:
node --version
=
facing same issue
Do you have any sort of snippet that you can post to show your ng-idle setup?
idleTimeOut(time) { this.idle.setIdle(time); this.idle.setTimeout(30); this.idle.setInterrupts(DEFAULT_INTERRUPTSOURCES);
this.idleEndSubscription = this.idle.onIdleEnd.subscribe(() => {
this.idleState = 'No longer idle.';
this.idle.watch();
this.reset();
});
this.timeOutSubscription = this.idle.onTimeout.subscribe(() => {
this.idleState = 'Timed out!';
this.logout();
});
this.idleStartSubscription = this.idle.onIdleStart.subscribe(() => {
if (this.timeoutModalRef !== undefined) {
this.timeoutModalRef.close();
}
if (!this.isRequesting)
this.openTimeoutModal(this.content);
this.idleState = 'You\'ve gone idle!';
});
this.timeOutWarningSubscription = this.idle.onTimeoutWarning.subscribe((countdown) => {
this.warningTimeout = countdown + 's';
this.percentage = countdown * 100 / 30;
this.idleState = 'You will be automatically logged out in ' + countdown + ' seconds!';
});
this.keepalive.interval(15);
this.keepalive.onPing.subscribe(() => this.lastPing = new Date());
this.reset();
}
Any updates? i am also facing the same issue
Did you guys find a way to add the Sleep interrupt somehow?
Thank you @HackedByChinese for this amazing library!