feat: Improve VIN photo capture camera crop (#123) #124

Merged
egullickson merged 2 commits from issue-123-improve-vin-camera-crop into main 2026-02-09 00:36:44 +00:00
Showing only changes of commit 1ff1931864 - Show all commits

View File

@@ -151,7 +151,15 @@ export const CameraCapture: React.FC<CameraCaptureProps> = ({
setCapturedFile(null);
setCapturedImageSrc(null);
setCaptureState('viewfinder');
}, [capturedImageSrc]);
// Re-request camera if stream tracks are no longer active
const isStreamActive = stream?.getVideoTracks().some(
(track) => track.readyState === 'live'
);
if (!isStreamActive) {
requestPermission();
}
}, [capturedImageSrc, stream, requestPermission]);
const handleCropReset = useCallback(() => {
// Just reset crop area, keep the captured image