diff --git a/src/components/modals/sleep-timer/sleep-timer.tsx b/src/components/modals/sleep-timer/sleep-timer.tsx index 6b9355c..be48399 100644 --- a/src/components/modals/sleep-timer/sleep-timer.tsx +++ b/src/components/modals/sleep-timer/sleep-timer.tsx @@ -21,6 +21,8 @@ export function SleepTimerModal({ onClose, show }: SleepTimerModalProps) { const timerId = useRef(); + const isPlaying = useSoundStore(state => state.isPlaying); + const play = useSoundStore(state => state.play); const pause = useSoundStore(state => state.pause); const calculateTotalSeconds = useCallback((): number => { @@ -36,6 +38,7 @@ export function SleepTimerModal({ onClose, show }: SleepTimerModalProps) { const handleStart = () => { if (timerId.current) clearInterval(timerId.current); + if (!isPlaying) play(); setTimeLeft(calculateTotalSeconds); setRunning(true);