ng2-idle icon indicating copy to clipboard operation
ng2-idle copied to clipboard

NG Idle pauses if computer goes to sleep mode?

Open alexsim88 opened this issue 6 years ago • 5 comments

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 =

alexsim88 avatar Jul 26 '18 06:07 alexsim88

facing same issue

ZahraFatima avatar Jul 31 '18 05:07 ZahraFatima

Do you have any sort of snippet that you can post to show your ng-idle setup?

grbsk avatar Aug 02 '18 19:08 grbsk

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();

}

ZahraFatima avatar Nov 08 '18 06:11 ZahraFatima

Any updates? i am also facing the same issue

subinmathewit avatar Apr 02 '19 08:04 subinmathewit

Did you guys find a way to add the Sleep interrupt somehow?

Thank you @HackedByChinese for this amazing library!

nicolae-olariu avatar Jun 25 '19 10:06 nicolae-olariu