mirror of
https://github.com/remvze/moodist.git
synced 2025-12-17 00:44:14 +00:00
fix: disable the sleep timer when no sound is selected
This commit is contained in:
parent
4f45279938
commit
d42eb25f7b
1 changed files with 2 additions and 0 deletions
|
|
@ -17,6 +17,7 @@ interface SleepTimerModalProps {
|
|||
|
||||
export function SleepTimerModal({ onClose, show }: SleepTimerModalProps) {
|
||||
const setActive = useSleepTimerStore(state => state.set);
|
||||
const noSelected = useSoundStore(state => state.noSelected());
|
||||
|
||||
const [running, setRunning] = useState(false);
|
||||
|
||||
|
|
@ -47,6 +48,7 @@ export function SleepTimerModal({ onClose, show }: SleepTimerModalProps) {
|
|||
|
||||
const handleStart = () => {
|
||||
if (timerId.current) clearInterval(timerId.current);
|
||||
if (noSelected) return;
|
||||
if (!isPlaying) play();
|
||||
|
||||
if (totalSeconds > 0) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue