Prevent timer restarting on page refresh #203
-
Hi, Would you be able to advise me on the best practice for keeping the timer counting down if the page is re-rendered? The scenario,
In this scenario what is the best practice to keep the timer running from where it was when the back button was clicked? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hey, you will need to keep the remaining time somewhere else but the local App state, like in a |
Beta Was this translation helpful? Give feedback.
-
@vydimitrov thanks for the feedback! In the end I found that it was a problem in my code... when the back browser button was clicked, the loading animation would appear. When I clicked cancel, the page would be re-rendered... and so the timer would re-start. solution: I removed the loading animation and used nprogress instead. |
Beta Was this translation helpful? Give feedback.
-
onUpdate function is not working for me. Please check the way I'm calling it. Is this the right way or not. <CountdownCircleTimer |
Beta Was this translation helpful? Give feedback.
@vydimitrov thanks for the feedback! In the end I found that it was a problem in my code... when the back browser button was clicked, the loading animation would appear. When I clicked cancel, the page would be re-rendered... and so the timer would re-start.
solution: I removed the loading animation and used nprogress instead.