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