|
|
@ -184,6 +184,10 @@ export const check_has_camera = async () => { |
|
|
|
let has_camera: boolean | "checking" = "checking"; |
|
|
|
let has_camera: boolean | "checking" = "checking"; |
|
|
|
|
|
|
|
|
|
|
|
if (!use_native_cam) { |
|
|
|
if (!use_native_cam) { |
|
|
|
|
|
|
|
if (tauri_platform) { |
|
|
|
|
|
|
|
has_camera = false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
// If there is a camera, go to scan mode, else gen mode.
|
|
|
|
// If there is a camera, go to scan mode, else gen mode.
|
|
|
|
try { |
|
|
|
try { |
|
|
|
const devices = await navigator.mediaDevices.enumerateDevices(); |
|
|
|
const devices = await navigator.mediaDevices.enumerateDevices(); |
|
|
@ -192,6 +196,7 @@ export const check_has_camera = async () => { |
|
|
|
} catch { |
|
|
|
} catch { |
|
|
|
has_camera = false; |
|
|
|
has_camera = false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// TODO: There does not seem to be an API for checking, if the native device
|
|
|
|
// TODO: There does not seem to be an API for checking, if the native device
|
|
|
|