Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

121
Vistas
ngidle timer resumes when browser sleeps

I am creating the project using angular. In my project i have used the library ngIdle for when the system goes idle it will give the popup with timer and after that user will logout from the system.

The problem in this when browser goes sleep, then timer is resuming.

https://moribvndvs.github.io/ng2-idle/

Here is the code:

idle.setIdle(5);
    // sets a timeout period of 5 seconds. after 10 seconds of inactivity, the user will be considered timed out.
    idle.setTimeout(60);
    // sets the default interrupts, in this case, things like clicks, scrolls, touches to the document
    idle.setInterrupts(DEFAULT_INTERRUPTSOURCES);

    idle.onIdleEnd.subscribe(() => this.idleState = 'No longer idle.');
    idle.onTimeout.subscribe(() => {
      this.idleState = 'Timed out!';
      this.timedOut = true;
    });
    idle.onIdleStart.subscribe(() => this.idleState = 'You\'ve gone idle!');
    idle.onTimeoutWarning.subscribe((countdown) => {
    this.idleState = 'You will time out in ' + countdown + ' seconds!'
    console.log(this.idleState)
  }
    
    );

    // sets the ping interval to 15 seconds
    keepAlive.interval(15);

    keepAlive.onPing.subscribe(() => this.lastPing = new Date());

    this.reset();

 reset() {
  //  this.idle.setTimeout(false);
    this.idle.watch();
    this.idleState = 'Started.';
    this.timedOut = false;
  }

When i put the this.idle.setTimeout(false); in the reset then timer is not initiating.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda