@getpara/react-sdk-lite 2.0.0-alpha.62 → 2.0.0-alpha.63

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.
@@ -57,6 +57,7 @@ const ParaModal = forwardRef((props, ref) => {
57
57
  const externalWallets = useStore((state) => state.externalWallets);
58
58
  const providerProps = useStore((state) => state.providerProps);
59
59
  const setAccountLinkOptions = useModalStore((state) => state.setAccountLinkOptions);
60
+ const selectedExternalWallet = useModalStore((state) => state.selectedExternalWallet);
60
61
  const isInitialized = useRef(false);
61
62
  const _a = __spreadValues(__spreadValues({}, storedModalConfig), props), {
62
63
  isOpen: configIsOpen,
@@ -223,10 +224,10 @@ const ParaModal = forwardRef((props, ref) => {
223
224
  updateSelectedWallet();
224
225
  }, [para]);
225
226
  useEffect(() => {
226
- if (bareModal && !isAccountLoading && !isConnected && !["signup", "login"].includes(flow != null ? flow : "") && modalRefs.currentStep.current !== ModalStep.AUTH_MAIN) {
227
+ if (bareModal && !selectedExternalWallet && !isAccountLoading && !isConnected && !["signup", "login"].includes(flow != null ? flow : "") && modalRefs.currentStep.current !== ModalStep.AUTH_MAIN) {
227
228
  setStep(ModalStep.AUTH_MAIN);
228
229
  }
229
- }, [bareModal, flow, isConnected, isAccountLoading]);
230
+ }, [bareModal, flow, isConnected, isAccountLoading, selectedExternalWallet]);
230
231
  useEffect(() => {
231
232
  setAccountLinkOptions(propsSupportedAccountLinks != null ? propsSupportedAccountLinks : para == null ? void 0 : para.supportedAccountLinks);
232
233
  }, [propsSupportedAccountLinks, para == null ? void 0 : para.supportedAccountLinks]);
@@ -6,11 +6,11 @@ import { CpslIcon, CpslText } from "@getpara/react-components";
6
6
  import { PARA_TERMS_AND_CONDITIONS } from "../../constants/constants.js";
7
7
  import { useModalStore } from "../../stores/index.js";
8
8
  import { ModalStep } from "../../utils/steps.js";
9
- import { useAccount } from "../../../provider/index.js";
9
+ import { useAccountLinking } from "../../../provider/providers/AccountLinkProvider.js";
10
10
  const Footer = () => {
11
- const { isConnected } = useAccount();
12
11
  const currentStep = useModalStore((state) => state.step);
13
- const showFooter = !isConnected && [
12
+ const { accountLinkInProgress } = useAccountLinking();
13
+ const showFooter = !accountLinkInProgress && [
14
14
  ModalStep.AUTH_MAIN,
15
15
  ModalStep.AUTH_MORE,
16
16
  ModalStep.EX_WALLET_NETWORK_SELECT,
@@ -126,7 +126,7 @@ const BODY_MOTION_VARIANTS = {
126
126
  const BODY_TRANSITION = {
127
127
  duration: 0.2
128
128
  };
129
- const SDK_VERSION = "2.0.0-alpha.62";
129
+ const SDK_VERSION = "2.0.0-alpha.63";
130
130
  export {
131
131
  BODY_MOTION_VARIANTS,
132
132
  BODY_TRANSITION,
@@ -74,7 +74,7 @@ const useAccount = ({ cosmos } = {}) => {
74
74
  connectionType = "external";
75
75
  }
76
76
  }
77
- const isEmbeddedConnected = paraAccount.isConnected && (!!paraAccount.userId || paraAccount.isGuestMode);
77
+ const isEmbeddedConnected = connectionType === "embedded" || connectionType === "both";
78
78
  const connectedNetworks = [];
79
79
  if (evmAccount == null ? void 0 : evmAccount.isConnected) {
80
80
  connectedNetworks.push("evm");
@@ -70,7 +70,7 @@ const AccountLinkProvider = ({ children }) => {
70
70
  var _a, _b, _c;
71
71
  const para = useInternalClient();
72
72
  const queryClient = useQueryClient();
73
- const account = useAccount();
73
+ const { embedded } = useAccount();
74
74
  const { data: coreAccountLinkInProgress } = useAccountLinkInProgress();
75
75
  const {
76
76
  wallets,
@@ -112,7 +112,6 @@ const AccountLinkProvider = ({ children }) => {
112
112
  status: statusVerifyExternalWalletLink,
113
113
  reset: resetVerifyExternalWalletLink
114
114
  } = useVerifyExternalWalletLink();
115
- const { embedded } = account;
116
115
  const isEnabled = (embedded == null ? void 0 : embedded.isConnected) || !(embedded == null ? void 0 : embedded.isGuestMode) && (!((_a = para.authInfo) == null ? void 0 : _a.externalWallet) || includeWalletVerification || externalWalletsWithFullAuth === "ALL" || externalWalletsWithFullAuth.includes((_c = (_b = para.authInfo) == null ? void 0 : _b.externalWallet) == null ? void 0 : _c.providerId));
117
116
  const [accountLinkInProgress, setAccountLinkInProgress] = useState(
118
117
  coreAccountLinkInProgress || void 0
@@ -277,7 +277,8 @@ function AuthProvider({
277
277
  ModalStep.AWAITING_ACCOUNT,
278
278
  ModalStep.OTP,
279
279
  ModalStep.FARCASTER_OAUTH,
280
- ModalStep.TELEGRAM_OAUTH
280
+ ModalStep.TELEGRAM_OAUTH,
281
+ ModalStep.AWAITING_OAUTH
281
282
  ]),
282
283
  onPoll: () => {
283
284
  goBackIfPopupClosedOnSteps([
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@getpara/react-sdk-lite",
3
- "version": "2.0.0-alpha.62",
3
+ "version": "2.0.0-alpha.63",
4
4
  "bin": {
5
5
  "setup-para": "dist/cli/cli.mjs"
6
6
  },
7
7
  "dependencies": {
8
- "@getpara/react-common": "2.0.0-alpha.62",
9
- "@getpara/react-components": "2.0.0-alpha.62",
10
- "@getpara/web-sdk": "2.0.0-alpha.62",
8
+ "@getpara/react-common": "2.0.0-alpha.63",
9
+ "@getpara/react-components": "2.0.0-alpha.63",
10
+ "@getpara/web-sdk": "2.0.0-alpha.63",
11
11
  "date-fns": "^3.6.0",
12
12
  "framer-motion": "^11.3.31",
13
13
  "libphonenumber-js": "^1.11.7",
@@ -16,9 +16,9 @@
16
16
  "zustand-sync-tabs": "^0.2.2"
17
17
  },
18
18
  "devDependencies": {
19
- "@getpara/cosmos-wallet-connectors": "2.0.0-alpha.62",
20
- "@getpara/evm-wallet-connectors": "2.0.0-alpha.62",
21
- "@getpara/solana-wallet-connectors": "2.0.0-alpha.62",
19
+ "@getpara/cosmos-wallet-connectors": "2.0.0-alpha.63",
20
+ "@getpara/evm-wallet-connectors": "2.0.0-alpha.63",
21
+ "@getpara/solana-wallet-connectors": "2.0.0-alpha.63",
22
22
  "@tanstack/react-query": "^5.74.0",
23
23
  "@testing-library/dom": "^10.4.0",
24
24
  "@testing-library/react": "^16.3.0",
@@ -38,7 +38,7 @@
38
38
  "package.json",
39
39
  "styles.css"
40
40
  ],
41
- "gitHead": "a4e8ee28afb86a2318449def68eb7fcefdb31745",
41
+ "gitHead": "440300efa66a6bc808504e2771b21e92bdee4c9b",
42
42
  "main": "dist/index.js",
43
43
  "peerDependencies": {
44
44
  "@tanstack/react-query": ">=5.0.0",