Guest User

Untitled

a guest
Nov 15th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. sessionCountdown = () => {
  2. const { session, updateSessionStatus } = this.props;
  3. clearTimeout(this.sessionTimer);
  4. clearTimeout(this.sessionWillExpireTimer);
  5. const sessionWillExpireIn = session.data.expirationDuration;
  6.  
  7. if (sessionWillExpireIn) {
  8. this.sessionTimer = setTimeout(() => {
  9. updateSessionStatus(SESSION_STATUSES.WILL_EXPIRE);
  10. this.sessionWillExpireTimer = setTimeout(() => {
  11. updateSessionStatus(SESSION_STATUSES.EXPIRED);
  12. }, SESSION_EXPIRATION_NOTICE);
  13. }, sessionWillExpireIn - SESSION_EXPIRATION_NOTICE);
  14. }
  15. };
Add Comment
Please, Sign In to add comment