@ai-matrx/vault 0.1.47 → 0.1.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1396,6 +1396,7 @@ import { useEffect as useEffect8, useRef as useRef6, useState as useState8 } fro
1396
1396
  import { Button as Button5, Field as Field2 } from "@ai-matrx/design-system/controls";
1397
1397
 
1398
1398
  // src/authenticator/qr.ts
1399
+ import { listMediaDevices } from "@ai-matrx/browser-audio/core";
1399
1400
  import { decodeQrFromElement, decodeQrFromImageFile } from "@ai-matrx/capture/qr";
1400
1401
  function canDecodeQrLocally() {
1401
1402
  if (typeof document === "undefined") return Promise.resolve(false);
@@ -1409,9 +1410,9 @@ function hasCamera() {
1409
1410
  return typeof navigator !== "undefined" && typeof navigator.mediaDevices?.getUserMedia === "function";
1410
1411
  }
1411
1412
  async function hasCameraDevice() {
1412
- if (!hasCamera() || typeof navigator.mediaDevices?.enumerateDevices !== "function") return false;
1413
+ if (!hasCamera()) return false;
1413
1414
  try {
1414
- return (await navigator.mediaDevices.enumerateDevices()).some((d) => d.kind === "videoinput");
1415
+ return (await listMediaDevices()).videoInputs.length > 0;
1415
1416
  } catch {
1416
1417
  return false;
1417
1418
  }