@getpara/react-sdk-lite 2.0.0-alpha.68 → 2.0.0-alpha.70

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.
@@ -112,7 +112,7 @@ const ParaModal = forwardRef((props, ref) => {
112
112
  }), rest),
113
113
  reactSdkVersion: SDK_VERSION
114
114
  });
115
- } catch (_) {
115
+ } catch (e) {
116
116
  }
117
117
  });
118
118
  trackAnalytics();
@@ -4,9 +4,10 @@ import { jsx } from "react/jsx-runtime";
4
4
  import { useModalStore } from "../../stores/index.js";
5
5
  import { Waiting } from "../Waiting/Waiting.js";
6
6
  const AwaitingAccountStep = () => {
7
+ var _a;
7
8
  const isLogin = useModalStore((state) => state.isLogin());
8
- const verifyState = useModalStore((state) => state.getVerifyState());
9
- const isSLOPopup = !!(verifyState == null ? void 0 : verifyState.isWalletSelectionNeeded);
9
+ const refs = useModalStore((state) => state.refs);
10
+ const isSLOPopup = ((_a = refs.popupWindow.current) == null ? void 0 : _a.closed) === false;
10
11
  return /* @__PURE__ */ jsx(
11
12
  Waiting,
12
13
  {
@@ -25,7 +25,7 @@ const getEmbeddedAccount = (para, isFullyLoggedIn) => __async(void 0, null, func
25
25
  let authMethods;
26
26
  try {
27
27
  authMethods = yield para.supportedUserAuthMethods();
28
- } catch (error) {
28
+ } catch (e) {
29
29
  authMethods = /* @__PURE__ */ new Set();
30
30
  }
31
31
  const value = {
@@ -31,7 +31,7 @@ const useAutoSessionKeepAlive = ({ disabled }) => {
31
31
  if (!sessionCookie) return null;
32
32
  const expiresMatch = sessionCookie.match(/Expires=([^;]+)/);
33
33
  return expiresMatch ? new Date(expiresMatch[1]) : null;
34
- } catch (err) {
34
+ } catch (e) {
35
35
  return null;
36
36
  }
37
37
  });
@@ -50,9 +50,10 @@ const useEventListeners = ({
50
50
  );
51
51
  const accountCreationListener = useCallback(
52
52
  (event) => {
53
+ loginOrSetupListener();
53
54
  onAccountCreation == null ? void 0 : onAccountCreation(event);
54
55
  },
55
- [onAccountCreation]
56
+ [loginOrSetupListener, onAccountCreation]
56
57
  );
57
58
  const logoutListener = useCallback(
58
59
  (event) => {
@@ -321,7 +321,7 @@ const AccountLinkProvider = ({ children }) => {
321
321
  accountLinkInProgress.externalWallet.type,
322
322
  { disconnectType: "ACCOUNT_LINKING" }
323
323
  );
324
- } catch (error) {
324
+ } catch (e) {
325
325
  }
326
326
  }
327
327
  setTimeout(() => {
@@ -153,7 +153,9 @@ function AuthProvider({
153
153
  setAuthStepRoute();
154
154
  setIFrameUrl();
155
155
  setIsIFrameReady(false);
156
- setStep(ModalStep.AWAITING_ACCOUNT);
156
+ if (refs.currentStep.current !== ModalStep.LOGIN_DONE && refs.currentStep.current !== ModalStep.AWAITING_ACCOUNT) {
157
+ setStep(ModalStep.AWAITING_ACCOUNT);
158
+ }
157
159
  }
158
160
  window.removeEventListener("message", handleMessage);
159
161
  messageHandlerRef.current = null;
@@ -187,7 +189,9 @@ function AuthProvider({
187
189
  onSuccess: () => {
188
190
  if (para.isNoWalletConfig) {
189
191
  onLoginComplete({
190
- on2faSetupOrError: () => setStep(ModalStep.LOGIN_DONE),
192
+ on2faSetupOrError: () => {
193
+ setStep(ModalStep.LOGIN_DONE);
194
+ },
191
195
  on2faNotSetup: () => setStep(ModalStep.SETUP_2FA)
192
196
  });
193
197
  } else {
@@ -478,11 +478,11 @@ function ExternalWalletProvider({ children }) {
478
478
  } else {
479
479
  throw new Error("Unknown error linking external wallet");
480
480
  }
481
- } catch (linkError) {
481
+ } catch (e) {
482
482
  }
483
483
  yield connectEmbeddedToExternalConnectors();
484
484
  setStep(ModalStep.ACCOUNT_PROFILE);
485
- } catch (error) {
485
+ } catch (e) {
486
486
  setExternalWalletError(["Failed to add wallet. Please try again."]);
487
487
  }
488
488
  }),
@@ -633,6 +633,7 @@ function ExternalWalletProvider({ children }) {
633
633
  if (popupCloseIntervalRef.current) {
634
634
  clearInterval(popupCloseIntervalRef.current);
635
635
  popupCloseIntervalRef.current = null;
636
+ refs.popupWindow.current = null;
636
637
  }
637
638
  };
638
639
  const handlePostConnectRetry = () => {
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@getpara/react-sdk-lite",
3
- "version": "2.0.0-alpha.68",
3
+ "version": "2.0.0-alpha.70",
4
4
  "bin": {
5
5
  "setup-para": "dist/cli/cli.mjs"
6
6
  },
7
7
  "dependencies": {
8
- "@getpara/react-common": "2.0.0-alpha.68",
9
- "@getpara/react-components": "2.0.0-alpha.68",
10
- "@getpara/web-sdk": "2.0.0-alpha.68",
8
+ "@getpara/react-common": "2.0.0-alpha.70",
9
+ "@getpara/react-components": "2.0.0-alpha.70",
10
+ "@getpara/web-sdk": "2.0.0-alpha.70",
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.68",
20
- "@getpara/evm-wallet-connectors": "2.0.0-alpha.68",
21
- "@getpara/solana-wallet-connectors": "2.0.0-alpha.68",
19
+ "@getpara/cosmos-wallet-connectors": "2.0.0-alpha.70",
20
+ "@getpara/evm-wallet-connectors": "2.0.0-alpha.70",
21
+ "@getpara/solana-wallet-connectors": "2.0.0-alpha.70",
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": "98955203281606201609bb4674f5984acb63d3bf",
41
+ "gitHead": "99d44cff3c68c07dc1cd8c2709b6ca4cd57dca61",
42
42
  "main": "dist/index.js",
43
43
  "peerDependencies": {
44
44
  "@tanstack/react-query": ">=5.0.0",