We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 39e4ac5 commit 57f5291Copy full SHA for 57f5291
1 file changed
Sprint-3/alarmclock/alarmclock.js
@@ -33,6 +33,12 @@ function setAlarm() {
33
clearInterval(countdownId);
34
}
35
36
+ // Clear the alarm timeout if it exists
37
+ if (alarmTimeoutId !== null) {
38
+ clearTimeout(alarmTimeoutId);
39
+ alarmTimeoutId = null;
40
+ }
41
+
42
// Reset background and stop alarm sound when setting a new alarm
43
document.body.style.backgroundColor = originalBackgroundColor;
44
pauseAlarm();
@@ -78,11 +84,6 @@ function playAlarm() {
78
84
79
85
function pauseAlarm() {
80
86
audio.pause();
81
- // Clear the alarm timeout if it exists
82
- if (alarmTimeoutId !== null) {
83
- clearTimeout(alarmTimeoutId);
- alarmTimeoutId = null;
- }
87
88
89
window.onload = setup;
0 commit comments