fix(vision): clear config when switching camera sources

When switching between local and phone camera, clear the other
source's configuration to prevent stale data.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Thomas Hallock 2026-01-01 15:13:20 -06:00
parent d8c764595d
commit ff59612e7b
1 changed files with 5 additions and 1 deletions

View File

@ -137,13 +137,17 @@ export function AbacusVisionBridge({
if (source === 'phone') {
// Stop local camera - session will be created by RemoteCameraQRCode
vision.disable()
// Clear local camera config in parent context
onConfigurationChange?.({ cameraDeviceId: null, calibration: null })
} else {
// Stop remote session and start local camera
setRemoteCameraSessionId(null)
vision.enable()
// Clear remote session config in parent context
onConfigurationChange?.({ remoteCameraSessionId: null })
}
},
[vision]
[vision, onConfigurationChange]
)
// Handle session created by QR code component