@ai-matrx/vault 0.1.49 → 0.1.51

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
@@ -55,7 +55,7 @@ import {
55
55
  useCopy,
56
56
  useNotify,
57
57
  wasCancelled
58
- } from "./chunk-LXFJBJR6.js";
58
+ } from "./chunk-YDYTU3NY.js";
59
59
 
60
60
  // src/VaultApp.tsx
61
61
  import { useCallback as useCallback4, useEffect as useEffect22, useMemo as useMemo6, useRef as useRef18, useState as useState40, useSyncExternalStore as useSyncExternalStore5 } from "react";
@@ -1666,8 +1666,10 @@ import { CopyIcon as CopyIcon4 } from "@ai-matrx/design-system/icons";
1666
1666
  // src/authenticator/port.ts
1667
1667
  var OTP_SEED_KEY = "totp_seed";
1668
1668
  function mfaMethodOf(item) {
1669
- const v = item.custom.find((c) => c.key === MFA_METHOD_KEY)?.value;
1670
- return v === "sms" ? "sms" : v ? "push_or_other" : null;
1669
+ const declarations = item.custom.filter((c) => c.key === MFA_METHOD_KEY);
1670
+ if (declarations.length !== 1) return null;
1671
+ const value = declarations[0]?.value;
1672
+ return value === "sms" || value === "push_or_other" ? value : null;
1671
1673
  }
1672
1674
 
1673
1675
  // src/authenticator/TotpRows.tsx
@@ -5024,7 +5026,7 @@ function withMfaMethod(custom, v) {
5024
5026
  return v === "sms" || v === "push_or_other" ? [...rest, { key: MFA_METHOD_KEY, label: "Two-factor method", value: v }] : rest;
5025
5027
  }
5026
5028
  function DraftTwoFactorRow({ custom, onCustom }) {
5027
- const value = custom.find((c) => c.key === MFA_METHOD_KEY)?.value || "none";
5029
+ const value = mfaMethodOf({ custom }) ?? "none";
5028
5030
  return /* @__PURE__ */ jsx19(VaultRow, { label: "Two-factor", children: /* @__PURE__ */ jsx19(
5029
5031
  Select7,
5030
5032
  {