Birmingham | 26-ITP-May | Ogbemi Mene | Sprint 3 | my alarm app - #1329
Birmingham | 26-ITP-May | Ogbemi Mene | Sprint 3 | my alarm app#1329meneogbemi42-bit wants to merge 4 commits into
Conversation
cjyuan
left a comment
There was a problem hiding this comment.
Looks good. Just one minor issue.
| if (countdownInterval) { | ||
| clearInterval(countdownInterval); | ||
| } |
There was a problem hiding this comment.
What other application states should also be reset before starting a new countdown?
Note: a user may not click the "Stop" button first before starting a new count down.
There was a problem hiding this comment.
i added the paulse Alarm right after validating the input because If the previous alarm reached zero and audio was currently playing, setting a brand-new timer without clicking the Stop button first would leave the old audio playing in the background while the new countdown started. This stops any active sound immediately. and secondly i (input.value = "") after starting the timer. This cleans up the user interface so the input box doesn't stay pre-filled with old numbers while the countdown is actively running. i don't know if this meet what you mean in the question you asked.
There was a problem hiding this comment.
Yes. I was referring to the alarm. Clearing the input field is also a good idea.
Well done!
Self checklist
This PR implements the previously-empty setAlarm function for the Sprint-3 alarm clock. It adds a countdown timer (with input validation, formatted MM:SS display, interval management) and plays alarmsound.mp3 when the timer reaches zero.