@orangecheck/auth-client 2.32.3 → 2.33.1

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.mjs CHANGED
@@ -849,6 +849,10 @@ function OcAccountPill({
849
849
  }
850
850
  );
851
851
  }
852
+ function accountAddress(account) {
853
+ if (account?.primaryBtc) return account.primaryBtc;
854
+ return account?.displayIdentity?.kind === "btc" ? account.displayIdentity.value : null;
855
+ }
852
856
  function useOcAddressSuggestion(options) {
853
857
  const {
854
858
  value,
@@ -858,7 +862,7 @@ function useOcAddressSuggestion(options) {
858
862
  suggestionClassName
859
863
  } = options;
860
864
  const { status, account } = useOcSession();
861
- const sessionAddress = status === "authenticated" ? account?.primaryBtc ?? null : null;
865
+ const sessionAddress = status === "authenticated" ? accountAddress(account) : null;
862
866
  const [open, setOpen] = React4.useState(false);
863
867
  const [highlighted, setHighlighted] = React4.useState(false);
864
868
  const blurTimer = React4.useRef(null);
@@ -990,7 +994,7 @@ var OcAddressInput = React4.forwardRef(
990
994
  ...rest
991
995
  }, forwardedRef) {
992
996
  const { status, account } = useOcSession();
993
- const sessionAddress = status === "authenticated" ? account?.primaryBtc ?? null : null;
997
+ const sessionAddress = status === "authenticated" ? accountAddress(account) : null;
994
998
  const [open, setOpen] = React4.useState(false);
995
999
  const [highlighted, setHighlighted] = React4.useState(false);
996
1000
  const innerRef = React4.useRef(null);