Fix background playback: remove duplicate hidden-tab play effect

This commit is contained in:
ru-aish 2026-02-11 17:27:13 +05:30
parent d04ab733d2
commit 4310098949

View file

@ -34,20 +34,5 @@ export function useBackgroundState({ activeHowl, isPlaying, keepPlayingInBackgro
};
}, [isPlaying, activeHowl, keepPlayingInBackground]);
useEffect(() => {
if (!document.hidden || !activeHowl || !isPlaying) return;
if (keepPlayingInBackground) {
if (!activeHowl.playing()) {
activeHowl.play();
}
return;
}
if (activeHowl.playing()) {
activeHowl.pause();
}
}, [activeHowl, isPlaying, keepPlayingInBackground]);
return isBackgrounded;
}