Improve camera support and photo capture, especially on tablets

Enhance camera functionalities with improved constraints, fallbacks, UI, and error handling within CameraModal and useCamera hook.

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/dcf949f8-2931-4556-aa3c-e4bf61346ee3.jpg
This commit is contained in:
michaelschal committed 2025-07-11 15:54:44 +00:00
1 parent a589c8b770
commit 9b0a09614a
4 files changed
+82 -9

No files matched your search

+10
View File
@@ -180,6 +180,16 @@ export default function NewSaleForm() {
// Photo capture functions
const handlePhotoCapture = async (photoType: PhotoType) => {
// Vérifier d'abord si les caméras sont supportées
if (!navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) {
toast({
title: "Caméra non supportée",
description: "Votre navigateur ne supporte pas l'accès aux caméras",
variant: "destructive",
});
return;
}
try {
await startCamera(photoType);
} catch (error) {