From bfae55afa3c205b3f217b65a81f8cad2b137fe39 Mon Sep 17 00:00:00 2001 From: Yuri Tatishchev Date: Tue, 10 Feb 2026 00:30:38 -0800 Subject: [PATCH] fix --- .../components/player/PlayerDesktop.svelte | 30 ++----------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/src/lib/components/player/PlayerDesktop.svelte b/src/lib/components/player/PlayerDesktop.svelte index 742019a..f5bf3a1 100644 --- a/src/lib/components/player/PlayerDesktop.svelte +++ b/src/lib/components/player/PlayerDesktop.svelte @@ -9,28 +9,6 @@ const audio = getAudioContext(); - // Local state for slider to allow binding - let sliderValue = $state([0]); - - // Sync Audio -> Slider - $effect(() => { - // Only sync if the value is different to avoid unnecessary updates - // and potential loops if onValueChange fires on prop change. - // Using a small threshold or just direct assignment if we trust the loop break. - if (Math.abs(sliderValue[0] - audio.currentTime) > 0.1) { - sliderValue = [audio.currentTime]; - } - }); - - function onSeek(v: number[]) { - // Guard against feedback loop: - // If the value matches current time (within tolerance), it's likely a feedback - // from the effect above -> component -> onValueChange. - if (Math.abs(v[0] - audio.currentTime) < 0.1) return; - - audio.seek(v[0]); - } - function onVolume(v: number[]) { player.setVolume(v[0]); } @@ -72,12 +50,10 @@
-