fix: preserve other cameras' volume when adjusting one

setVolumeStates was replacing the entire state object instead of
merging, so changing one camera's volume reset all others to default.

Uses the functional update pattern to preserve existing state, matching
how toggleAudio already works.
This commit is contained in:
ryzendigo 2026-03-17 16:19:42 +08:00
parent 722ef6a1fe
commit 1cef9ebb08

View File

@ -570,9 +570,10 @@ export default function LiveDashboardView({
toggleStats={() => toggleStats(camera.name)}
volumeState={volumeStates[camera.name] ?? 1}
setVolumeState={(value) =>
setVolumeStates({
setVolumeStates((prev) => ({
...prev,
[camera.name]: value,
})
}))
}
muteAll={muteAll}
unmuteAll={unmuteAll}