Skip to content

Commit c9aa8f1

Browse files
committed
reset any flashing and playing audio
1 parent 7ded280 commit c9aa8f1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Sprint-3/alarmclock/alarmclock.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ if (isNaN(parsed) || parsed < 0) {
4949

5050
// Clear previous countdown
5151
clearInterval(timer);
52+
clearInterval(flashing); // stop flashing if it was active
53+
flashing = null;
54+
document.body.style.backgroundColor = "";
55+
pauseAlarm(); // stop any playing audio
56+
audio.currentTime = 0;
5257

5358
// Start countdown every 1000ms
5459
timer = setInterval(() => {

0 commit comments

Comments
 (0)