Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to reset the countdown again revisit the page #14

Closed
dhanarajp opened this issue Jan 24, 2018 · 5 comments
Closed

How to reset the countdown again revisit the page #14

dhanarajp opened this issue Jan 24, 2018 · 5 comments
Assignees
Labels

Comments

@dhanarajp
Copy link

Hi,
how to reset the countdown if again revisit the page.

Scenario:
configured: 60sec

  1. Once login the page, countdown start
  2. after 60sec automatically logout
  3. try to login again the page, but countdown not restart
@cipchk
Copy link
Owner

cipchk commented Jan 24, 2018

When the target component is destroyed, i think can work. otherwise, just call restart() or resume() again.

@cipchk cipchk closed this as completed in db58979 Apr 5, 2018
cipchk added a commit that referenced this issue Apr 5, 2018
cipchk added a commit that referenced this issue Apr 5, 2018
cipchk added a commit that referenced this issue Apr 5, 2018
@belall-shaikh
Copy link

belall-shaikh commented Jul 23, 2018

I think the issue is still present in 3.0.1

@belall-shaikh
Copy link

check at https://stackblitz.com/edit/ngx-countdown-issue
steps to reproduce
1- view timer route
2- wait till time finishes.
3- revisit the route

you will see that the timer doesn't start unless the page is refreshed.

@cipchk cipchk reopened this Jul 24, 2018
@cipchk cipchk self-assigned this Jul 24, 2018
@belall-shaikh
Copy link

I was able to fix this by calling the counter restart in a setTimeout method in ngOnInit

setTimeout(() => this.counter.restart());

@belall-shaikh
Copy link

I have updated the example: https://stackblitz.com/edit/ngx-countdown-issue

@cipchk cipchk added the check label Aug 3, 2018
@cipchk cipchk closed this as completed in f6925a9 Sep 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants