From 58df462ea15957def7aace495b84f3a1ae26d1c5 Mon Sep 17 00:00:00 2001
From: Niko PLP <niko@nextgraph.org>
Date: Sun, 14 Jul 2024 19:00:55 +0300
Subject: [PATCH] no cmaera on tauri desktop/laptop native apps

---
 ng-app/src/store.ts | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/ng-app/src/store.ts b/ng-app/src/store.ts
index 3927cf36..ae937165 100644
--- a/ng-app/src/store.ts
+++ b/ng-app/src/store.ts
@@ -184,14 +184,19 @@ export const check_has_camera = async () => {
     let has_camera: boolean | "checking" = "checking";
 
     if (!use_native_cam) {
-      // If there is a camera, go to scan mode, else gen mode.
-      try {
-        const devices = await navigator.mediaDevices.enumerateDevices();
-        has_camera =
-          devices.filter((device) => device.kind === "videoinput").length > 0;
-      } catch {
+      if (tauri_platform) {
         has_camera = false;
       }
+      else {
+        // If there is a camera, go to scan mode, else gen mode.
+        try {
+            const devices = await navigator.mediaDevices.enumerateDevices();
+            has_camera =
+            devices.filter((device) => device.kind === "videoinput").length > 0;
+        } catch {
+            has_camera = false;
+        }
+      }
 
     } else {
       // TODO: There does not seem to be an API for checking, if the native device