Fix volume gain not being applied immediately
This commit is contained in:
parent
a80b1fe931
commit
07b068a342
|
@ -59,7 +59,7 @@ export const usePlayer = createGlobalState(() => {
|
||||||
const lastVolume = useStorage('player:last-volume', 0.7)
|
const lastVolume = useStorage('player:last-volume', 0.7)
|
||||||
|
|
||||||
const volume: Ref<number> = useStorage('player:volume', 0.7)
|
const volume: Ref<number> = useStorage('player:volume', 0.7)
|
||||||
watch(volume, (gain) => setGain(gain))
|
watch(volume, (gain) => setGain(gain), { immediate: true })
|
||||||
|
|
||||||
const mute = () => {
|
const mute = () => {
|
||||||
if (volume.value > 0) {
|
if (volume.value > 0) {
|
||||||
|
|
Loading…
Reference in New Issue