Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49255

setTimeout not working after a peroid of time on device

$
0
0

@wekas wrote:

I am using the code below to auto log out a user when the token is due to expire. It works fine on the Android device for short periods of time (5 mins) but when I test for the hour needed it does not log out the user.
Also the buttons are unresponsive after coming back to the app.

Any ideas why this is not working?

private autoLogout(duration: number) {
    if (this.activeLogoutTimer) {
      clearTimeout(this.activeLogoutTimer);
    }
    this.activeLogoutTimer = setTimeout(() => {
      this.logout();
    }, duration);
  }

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 49255

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>