mirror of
https://github.com/R0m1k3/Regisflow.git
synced 2026-10-18 12:49:41 +02:00
Improve photo capture reliability and address camera access issues
Adds enhanced camera setup, error handling, and canvas drawing in `useCamera.tsx`, `CameraModal.tsx`, and `NewSaleForm.tsx`. Replit-Commit-Author: Agent Replit-Commit-Session-Id: dec54137-d5a2-4406-8ad4-5f2f9fb110bf Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/0715008c-7244-40f4-befc-26c014852236/e6a2493b-9ed8-4bd8-be32-29049cc60fa3.jpg
This commit is contained in:
1 parent
77d77ab658
commit
fbbe1375ab
3 files changed
+119
-26
No files matched your search
@@ -205,7 +205,10 @@ export default function NewSaleForm() {
|
||||
if (!currentPhotoType) return;
|
||||
|
||||
try {
|
||||
console.log('Attempting to capture photo...');
|
||||
const photoData = await capturePhoto();
|
||||
console.log('Photo captured successfully, data length:', photoData.length);
|
||||
|
||||
form.setValue(currentPhotoType === 'recto' ? 'photoRecto' : 'photoVerso', photoData);
|
||||
|
||||
toast({
|
||||
@@ -216,6 +219,7 @@ export default function NewSaleForm() {
|
||||
|
||||
stopCamera();
|
||||
} catch (error) {
|
||||
console.error('Photo capture error:', error);
|
||||
toast({
|
||||
title: "Erreur de capture",
|
||||
description: error instanceof Error ? error.message : "Erreur lors de la capture",
|
||||
|
||||
Reference in new issue
Block a user