fix(vision): hide flip camera button when only one camera available
Only show camera controls section when there's something to display: - Flip button: only if multiple cameras - Torch button: only if torch available - Whole section: only if either button would be shown 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
da97ad0675
commit
7a9185eadb
|
|
@ -415,8 +415,9 @@ export function AbacusVisionBridge({
|
|||
</button>
|
||||
</div>
|
||||
|
||||
{/* Camera controls (local camera) */}
|
||||
{cameraSource === 'local' && vision.availableDevices.length > 0 && (
|
||||
{/* Camera controls (local camera) - only show if there's something to display */}
|
||||
{cameraSource === 'local' &&
|
||||
(vision.availableDevices.length > 1 || vision.isTorchAvailable) && (
|
||||
<div
|
||||
data-element="camera-controls"
|
||||
className={css({
|
||||
|
|
@ -452,7 +453,8 @@ export function AbacusVisionBridge({
|
|||
</select>
|
||||
)}
|
||||
|
||||
{/* Flip camera button */}
|
||||
{/* Flip camera button - only show if multiple cameras available */}
|
||||
{vision.availableDevices.length > 1 && (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => vision.flipCamera()}
|
||||
|
|
@ -475,6 +477,7 @@ export function AbacusVisionBridge({
|
|||
>
|
||||
🔄
|
||||
</button>
|
||||
)}
|
||||
|
||||
{/* Torch toggle button (only if available) */}
|
||||
{vision.isTorchAvailable && (
|
||||
|
|
|
|||
Loading…
Reference in New Issue