I found this: https://github.com/freeCodeCamp/testable-projects-fcc/issues/515 , which states that this bug is on the “to-do list” to be fixed at some point. Should I submit my solution or is there something missing in my code(apart from the sound last more than 1 second) ?
This is so weird. The sound plays for me. Maybe it’s the browser’s fault… I really don’t know what to do right now and I can’t force anyone to thoroughly look into code…
I’m using Chrome Version 69.0.3497.100
I’m failing 3 more tests but I get the same error message in all of them so maybe it’s the same problem.
If you want to verify my Pen works you can set both the session and the break length to 1 minute and run the timer.
I reworked it a little bit. Before setInterval would always run depsite it not updating anything, now I clear it and set up a new one. Now when the test run my version behaves more like the example. However, the timeout errors still exist and I’m now getting this in the console:
Uncaught (in promise) DOMException: The play() request was interrupted by a call to pause().
Any thoughts? (Also, did you get the change to work on the Pomodoro Clock yourself like you said?)
Hi, I just had the same problem and it had to do with the fact that when either the minutes or seconds are less than 10, the Date object doesn’t show the “0” before the digit. So “9” instead of “09” for instance.
I think it is important that the clock always shows 4 digits “XX:XX” or it could mess up some of the logic.
I did this by adding conditionals for each minutes and seconds.
I have accounted for this and still get the error. From what I’ve gathered it’s probably due to bad timing of the sound and/or having 1 extra second during each switch.
I also finished that project today, same issue, everything seems to work properly. I bet that this is related to usage of setInterval(), any idea how to resolve it?
I feel you, I think we all do, but If you want some help with this u can reach out to me on discord if u have account there ( @Burzychs ) or via email <removed by moderator> - I’ll be glad to help
const time = this.state.minutes + ":" + this.state.seconds;
…
<h1 id={this.props.id}>{time}</h1>
Also, this: if (this.state.minutes === "00" && this.state.seconds === "00") {
became this: if (this.state.minutes === "00" && this.state.seconds === "01") {
Can’t believe it was CodePen’s fault all along…