Clean my (Pomodoro) Clock!

I’m putting the final touches on my pomodoro clock, and I’d like feedback from you all. I’m already aware of a couple of issues that I’d like help resolving, but I really need more critical eyes on the project.

The link:

Current issues: First, when you click the start button multiple times, the clock speeds up. I’m currently at a loss when it comes to fixing that. Next, once the clock has sped up, it cannot be paused. Lastly, any feedback on refactoring my code would be appreciated. I tried separating things out into different functions, but I’m not sure if I went about it in a way that’s clear to others.

Let me know what you think!

You can resolve your issue by modifying your startTimer and pauseTimer functions as follows:

function startTimer() {
    startBtn.disabled = true;
    x = setInterval(function(){toTime(time)}, 1000);

function pauseTimer() {
    startBtn.disabled = false;

This will prevent the Start button from being clicked again until the Pause button is clicked.

You also have a bug in the - button of the right text box (for setting break time) in that it allows negative numbers for time.

One other recommendation is to put labels above the timer setting boxes to clearly indicate which time (work or break) you are setting. Currently, you have to guess or look at the code to know for sure.

1 Like

Thanks for the feedback! That’s helpful.

1 Like