Skip to content

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
Signed-off-by: Param Siddharth <[email protected]>
  • Loading branch information
paramsiddharth committed Oct 16, 2024
1 parent 98656bf commit 355bc06
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ function App() {
const now = DateTime.now().toFormat("HH:mm");
if (now == alarmTime) {
setColour({ hex: alarmColour });
audioRef.current?.play();
if (soundEnabled) {
audioRef.current?.play();
}
clearInterval(interval);
}
}, 500);
Expand All @@ -71,7 +73,7 @@ function App() {

useEffect(() => {
if (!alarmEnabled) {
if (soundEnabled && audioRef.current) {
if (audioRef.current) {
audioRef.current.pause();
audioRef.current.currentTime = 0;
}
Expand Down

0 comments on commit 355bc06

Please sign in to comment.