Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

122
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda