question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Countdown resets before the end

See original GitHub issue

I have a countdown that refresh a page when it’s completed. Some time before that, I show a modal. When the modal is shown, the countdown starts again, making the refresh never happening.

Here’s some parts of the code :

render() {
const renderer = ({ hours, minutes, seconds, completed }) => {
      console.log('test : ' + seconds);
      return true;
    };
return (
     <Countdown
          date={Date.now() + 15000}
          renderer={renderer}
          onTick={({ hours, minutes, seconds, completed }) => {
            if (seconds === 10) {
              this.showModal();
            }
          }}
          onComplete={() => window.location.reload()}
        />
);
  }

Any idea?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
pavinduLakshancommented, Nov 25, 2019

@ndresx can confirm your solution works

1reaction
SoTDarksoulcommented, Sep 27, 2019

It might, I will try this today and update my answer.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Countdown timer | Lostpedia | Fandom
The countdown timer was regularly reset every 108 minutes, before and after the crash, a routine known as "pushing the button." As revealed...
Read more >
League ending and resetting at an earlier time than the usual
I just checked my leaderboard and my countdown is counting down to the normal time that the league ends for me. Mine has...
Read more >
How Do I Create A Countdown Time That Resets At A Specific ...
This is a simple countdown timer starting at 30 seconds from when the function is run and ending at 0. After reaching 0...
Read more >
Countdown timer question - Arcade - Microsoft MakeCode
Has anyone else tried to make a countdown timer that resets at the end of the countdown? My son is working on a...
Read more >
Countdown Resetter - Scripting Support - DevForum | Roblox
I've asked this once before and got a very vague answer that said … ... 50,1,-1 do wait(1) print('countdown: ',i) end print('resetting') end....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found