mirror of
https://github.com/R0m1k3/Regisflow.git
synced 2026-10-22 22:58:16 +02:00
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:
1 parent
a589c8b770
commit
9b0a09614a
4 files changed
+82
-9
No files matched your search
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user