fixes consumption of user preferences store

This commit is contained in:
Ollie Taylor
2023-02-24 20:03:10 +00:00
parent ea75a18671
commit becb001479
5 changed files with 16 additions and 28 deletions
+4 -7
View File
@@ -8,12 +8,9 @@
audio_loading,
audio_muted,
audio_paused,
audio_playback_rate,
audio_src,
audio_start_at,
audio_volume,
} from '$lib/context/audio-internals';
import { episode_progress } from '$lib/context/episode-progress';
import { user_preferences } from '$lib/context/user-preferences';
import type { PlayerElement } from '$lib/types/types';
import { onMount } from 'svelte';
@@ -26,9 +23,9 @@
let paused = false;
// handler values
let volume = $audio_volume;
let volume = $user_preferences.volume;
let playbackRate = $user_preferences.playback_rate;
let muted = false;
let playbackRate = 1;
// readonly - stores will update when bindings change
$: audio_element.set(element);
@@ -38,9 +35,9 @@
$: audio_paused.set(paused);
// handlers - when store value changes, the binding will update the audio element
$: volume = $audio_volume;
$: volume = $user_preferences.volume;
$: playbackRate = $user_preferences.playback_rate;
$: muted = $audio_muted;
$: playbackRate = $audio_playback_rate;
$: current_time = $audio_start_at;
onMount(() => {