fix: preserve other cameras' volume when adjusting one (#22508)

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-18 22:40:37 +08:00 committed by GitHub
parent dc27d4ad16
commit 2ace8d3670
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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}