@dynamic-labs/sdk-react-core 1.4.2 → 1.4.3
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/CHANGELOG.md +8 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +11 -11
- package/src/index.cjs +13 -13
- package/src/index.d.ts +289 -9
- package/src/lib/context/DynamicContext/DynamicContext.cjs +20 -22
- package/src/lib/context/DynamicContext/DynamicContext.js +22 -24
- package/src/lib/context/DynamicContext/handleDisconnectWallet/handleDisconnectWallet.cjs +1 -4
- package/src/lib/context/DynamicContext/handleDisconnectWallet/handleDisconnectWallet.d.ts +1 -7
- package/src/lib/context/DynamicContext/handleDisconnectWallet/handleDisconnectWallet.js +1 -4
- package/src/lib/context/DynamicContext/helpers/helpers.cjs +2 -2
- package/src/lib/context/DynamicContext/helpers/helpers.d.ts +2 -2
- package/src/lib/context/DynamicContext/helpers/helpers.js +2 -2
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/types.d.ts +1 -2
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.cjs +1 -2
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.js +1 -2
- package/src/lib/context/DynamicContext/hooks/useSetShowLinkNewWalletModal/useSetShowLinkNewWalletModal.cjs +1 -1
- package/src/lib/context/DynamicContext/hooks/useSetShowLinkNewWalletModal/useSetShowLinkNewWalletModal.js +1 -1
- package/src/lib/context/DynamicContext/types/index.d.ts +5 -2
- package/src/lib/context/LoadingContext/LoadingContext.cjs +1 -0
- package/src/lib/context/LoadingContext/LoadingContext.js +1 -0
- package/src/lib/data/api.cjs +3 -0
- package/src/lib/data/api.js +4 -1
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.cjs +1 -1
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.js +1 -1
- package/src/lib/utils/constants/localStorage.cjs +2 -2
- package/src/lib/utils/constants/localStorage.d.ts +1 -1
- package/src/lib/utils/constants/localStorage.js +2 -2
- package/src/lib/utils/hooks/index.d.ts +1 -0
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs +4 -1
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js +4 -1
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +2 -6
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.d.ts +2 -3
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +2 -6
- package/src/lib/utils/hooks/useHandleWalletsToConnect/useHandleWalletsToConnect.cjs +4 -5
- package/src/lib/utils/hooks/useHandleWalletsToConnect/useHandleWalletsToConnect.js +4 -5
- package/src/lib/utils/hooks/useNetworkNotSupported/index.d.ts +1 -0
- package/src/lib/utils/hooks/useNetworkNotSupported/useNetworkNotSupported.cjs +104 -0
- package/src/lib/utils/hooks/useNetworkNotSupported/useNetworkNotSupported.d.ts +3 -0
- package/src/lib/utils/hooks/useNetworkNotSupported/useNetworkNotSupported.js +100 -0
- package/src/lib/utils/hooks/useUserDataForm/useUserDataForm.cjs +5 -0
- package/src/lib/utils/hooks/useUserDataForm/useUserDataForm.js +6 -1
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.cjs +9 -31
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.js +10 -32
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.cjs +8 -31
- package/src/lib/views/NetworkNotSupportedSwitchManual/NetworkNotSupportedSwitchManual.js +8 -31
|
@@ -72,11 +72,11 @@ require('../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCa
|
|
|
72
72
|
var useInternalDynamicContext = require('../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.cjs');
|
|
73
73
|
|
|
74
74
|
const useHandleWalletsToConnect = () => {
|
|
75
|
-
const { bridgeChainsToConnect,
|
|
75
|
+
const { bridgeChainsToConnect, setShowAuthFlow, bridgeOnboardingCompleted, setBridgeOnboardingCompleted, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
76
76
|
const { setView, goToInitialView } = ViewContext.useViewContext();
|
|
77
77
|
const handleWalletsToConnect = ({ walletConnector, }) => {
|
|
78
78
|
if (!bridgeChainsToConnect) {
|
|
79
|
-
|
|
79
|
+
setBridgeOnboardingCompleted(true);
|
|
80
80
|
setShowAuthFlow(false);
|
|
81
81
|
return;
|
|
82
82
|
}
|
|
@@ -90,11 +90,10 @@ const useHandleWalletsToConnect = () => {
|
|
|
90
90
|
return goToInitialView();
|
|
91
91
|
}
|
|
92
92
|
const restOfWallets = bridgeChainsToConnect.filter((wallet) => wallet.chain !== (walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.connectedChain));
|
|
93
|
-
setBridgeChainsToConnect(restOfWallets);
|
|
94
93
|
const allWalletsConnected = restOfWallets.length === 0;
|
|
95
94
|
if (allWalletsConnected) {
|
|
96
|
-
if (!
|
|
97
|
-
|
|
95
|
+
if (!bridgeOnboardingCompleted) {
|
|
96
|
+
setBridgeOnboardingCompleted(true);
|
|
98
97
|
setView('bridge-summary');
|
|
99
98
|
}
|
|
100
99
|
else {
|
|
@@ -68,11 +68,11 @@ import '../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCar
|
|
|
68
68
|
import { useInternalDynamicContext } from '../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.js';
|
|
69
69
|
|
|
70
70
|
const useHandleWalletsToConnect = () => {
|
|
71
|
-
const { bridgeChainsToConnect,
|
|
71
|
+
const { bridgeChainsToConnect, setShowAuthFlow, bridgeOnboardingCompleted, setBridgeOnboardingCompleted, } = useInternalDynamicContext();
|
|
72
72
|
const { setView, goToInitialView } = useViewContext();
|
|
73
73
|
const handleWalletsToConnect = ({ walletConnector, }) => {
|
|
74
74
|
if (!bridgeChainsToConnect) {
|
|
75
|
-
|
|
75
|
+
setBridgeOnboardingCompleted(true);
|
|
76
76
|
setShowAuthFlow(false);
|
|
77
77
|
return;
|
|
78
78
|
}
|
|
@@ -86,11 +86,10 @@ const useHandleWalletsToConnect = () => {
|
|
|
86
86
|
return goToInitialView();
|
|
87
87
|
}
|
|
88
88
|
const restOfWallets = bridgeChainsToConnect.filter((wallet) => wallet.chain !== (walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.connectedChain));
|
|
89
|
-
setBridgeChainsToConnect(restOfWallets);
|
|
90
89
|
const allWalletsConnected = restOfWallets.length === 0;
|
|
91
90
|
if (allWalletsConnected) {
|
|
92
|
-
if (!
|
|
93
|
-
|
|
91
|
+
if (!bridgeOnboardingCompleted) {
|
|
92
|
+
setBridgeOnboardingCompleted(true);
|
|
94
93
|
setView('bridge-summary');
|
|
95
94
|
}
|
|
96
95
|
else {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useNetworkNotSupported } from './useNetworkNotSupported';
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var useWalletConnectorNetwork = require('../useWalletConnectorNetwork/useWalletConnectorNetwork.cjs');
|
|
7
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
8
|
+
require('@dynamic-labs/sdk-api');
|
|
9
|
+
require('../../../shared/logger.cjs');
|
|
10
|
+
require('@dynamic-labs/iconic');
|
|
11
|
+
require('react/jsx-runtime');
|
|
12
|
+
require('../../../context/ViewContext/ViewContext.cjs');
|
|
13
|
+
require('@dynamic-labs/wallet-book');
|
|
14
|
+
require('../../constants/colors.cjs');
|
|
15
|
+
require('../../constants/values.cjs');
|
|
16
|
+
require('../../../shared/utils/classes/storage/localStorage.cjs');
|
|
17
|
+
require('viem');
|
|
18
|
+
require('@dynamic-labs/utils');
|
|
19
|
+
require('../../../shared/consts/index.cjs');
|
|
20
|
+
require('../../../../../_virtual/_tslib.cjs');
|
|
21
|
+
require('@dynamic-labs/multi-wallet');
|
|
22
|
+
var isSupportedNetwork = require('../../functions/isSupportedNetwork/isSupportedNetwork.cjs');
|
|
23
|
+
require('viem/chains');
|
|
24
|
+
var useConnectAndSign = require('../authenticationHooks/useConnectAndSign/useConnectAndSign.cjs');
|
|
25
|
+
require('../../../context/DynamicContext/DynamicContext.cjs');
|
|
26
|
+
require('../../../events/dynamicEvents.cjs');
|
|
27
|
+
require('react-dom');
|
|
28
|
+
require('../../../config/ApiEndpoint.cjs');
|
|
29
|
+
require('../../../context/ThemeContext/ThemeContext.cjs');
|
|
30
|
+
require('@dynamic-labs/types');
|
|
31
|
+
require('../../../context/ErrorContext/ErrorContext.cjs');
|
|
32
|
+
require('../../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
33
|
+
require('yup');
|
|
34
|
+
require('react-i18next');
|
|
35
|
+
require('../../../context/MockContext/MockContext.cjs');
|
|
36
|
+
require('../useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs');
|
|
37
|
+
require('../../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
38
|
+
require('../../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
39
|
+
require('@dynamic-labs/rpc-providers');
|
|
40
|
+
require('../../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
41
|
+
require('../../../components/Alert/Alert.cjs');
|
|
42
|
+
require('../../../components/ShadowDOM/ShadowDOM.cjs');
|
|
43
|
+
require('../../../components/IconButton/IconButton.cjs');
|
|
44
|
+
require('../../../components/InlineWidget/InlineWidget.cjs');
|
|
45
|
+
require('../../../components/IsBrowser/IsBrowser.cjs');
|
|
46
|
+
require('../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
47
|
+
require('../../../components/Transition/ZoomTransition/ZoomTransition.cjs');
|
|
48
|
+
require('../../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
|
|
49
|
+
require('../../../components/Transition/OpacityTransition/OpacityTransition.cjs');
|
|
50
|
+
require('../../../components/Popper/Popper/Popper.cjs');
|
|
51
|
+
require('../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
52
|
+
require('react-focus-lock');
|
|
53
|
+
require('qrcode');
|
|
54
|
+
require('formik');
|
|
55
|
+
require('i18next');
|
|
56
|
+
require('../../../components/OverlayCard/OverlayCard.context.cjs');
|
|
57
|
+
require('../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs');
|
|
58
|
+
require('../../../context/PasskeyContext/PasskeyContext.cjs');
|
|
59
|
+
require('../../../views/WalletList/WalletList.cjs');
|
|
60
|
+
require('../../../context/EmailVerificationContext/EmailVerificationContext.cjs');
|
|
61
|
+
require('@hcaptcha/react-hcaptcha');
|
|
62
|
+
require('../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
63
|
+
require('../../../context/LoadingContext/LoadingContext.cjs');
|
|
64
|
+
require('../../../context/SocialRedirectContext/SocialRedirectContext.cjs');
|
|
65
|
+
require('../../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
66
|
+
require('../../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
|
|
67
|
+
require('../../../context/FooterAnimationContext/index.cjs');
|
|
68
|
+
require('../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
69
|
+
require('../../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
70
|
+
require('../../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs');
|
|
71
|
+
require('@dynamic-labs/viem-utils');
|
|
72
|
+
require('../../../views/TransactionConfirmationView/helpers/transactionErrorMessage.cjs');
|
|
73
|
+
require('../useTransactionWithGasPrice/useTransactionWithGasPrice.cjs');
|
|
74
|
+
require('../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
75
|
+
var useInternalDynamicContext = require('../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.cjs');
|
|
76
|
+
|
|
77
|
+
const useNetworkNotSupported = () => {
|
|
78
|
+
const { selectedWalletConnector: walletConnector, setShowAuthFlow, bridgeChainsToConnect, bridgeOnboardingCompleted, } = useInternalDynamicContext.useInternalDynamicContext();
|
|
79
|
+
const { network: walletConnectorNetwork } = useWalletConnectorNetwork.useWalletConnectorNetwork(walletConnector);
|
|
80
|
+
const finishConnectAndSign = useConnectAndSign.useConnectAndSign({
|
|
81
|
+
shouldCallCallback: false,
|
|
82
|
+
shouldUpdateWallets: Boolean(bridgeChainsToConnect === null || bridgeChainsToConnect === void 0 ? void 0 : bridgeChainsToConnect.length),
|
|
83
|
+
});
|
|
84
|
+
// Finishes auth flow when wallet switches to proper network
|
|
85
|
+
React.useEffect(() => {
|
|
86
|
+
if (!isSupportedNetwork.isSupportedNetwork({ network: walletConnectorNetwork, walletConnector })) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
finishConnectAndSign({
|
|
90
|
+
walletConnector: walletConnector,
|
|
91
|
+
});
|
|
92
|
+
// there are two scenarios here, one in not connected state and the other one in connected state.
|
|
93
|
+
// previously we were calling setShowAuthFlow(false) in useHandleWalletsToConnect.
|
|
94
|
+
// now, we don't call it in network-not-supported view, so we need to handle that scenario and close modal here
|
|
95
|
+
// this should be gone, once we're done with the useConnectAndSign hook refactor.
|
|
96
|
+
// TODO: https://linear.app/dynamic-labs/issue/QNTM-117/break-useconnectandsign-hook-to-small-parts
|
|
97
|
+
if (bridgeOnboardingCompleted) {
|
|
98
|
+
setShowAuthFlow(false);
|
|
99
|
+
}
|
|
100
|
+
}, [walletConnectorNetwork, setShowAuthFlow, bridgeOnboardingCompleted]);
|
|
101
|
+
return { currentNetwork: walletConnectorNetwork };
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
exports.useNetworkNotSupported = useNetworkNotSupported;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { useWalletConnectorNetwork } from '../useWalletConnectorNetwork/useWalletConnectorNetwork.js';
|
|
3
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
4
|
+
import '@dynamic-labs/sdk-api';
|
|
5
|
+
import '../../../shared/logger.js';
|
|
6
|
+
import '@dynamic-labs/iconic';
|
|
7
|
+
import 'react/jsx-runtime';
|
|
8
|
+
import '../../../context/ViewContext/ViewContext.js';
|
|
9
|
+
import '@dynamic-labs/wallet-book';
|
|
10
|
+
import '../../constants/colors.js';
|
|
11
|
+
import '../../constants/values.js';
|
|
12
|
+
import '../../../shared/utils/classes/storage/localStorage.js';
|
|
13
|
+
import 'viem';
|
|
14
|
+
import '@dynamic-labs/utils';
|
|
15
|
+
import '../../../shared/consts/index.js';
|
|
16
|
+
import '../../../../../_virtual/_tslib.js';
|
|
17
|
+
import '@dynamic-labs/multi-wallet';
|
|
18
|
+
import { isSupportedNetwork } from '../../functions/isSupportedNetwork/isSupportedNetwork.js';
|
|
19
|
+
import 'viem/chains';
|
|
20
|
+
import { useConnectAndSign } from '../authenticationHooks/useConnectAndSign/useConnectAndSign.js';
|
|
21
|
+
import '../../../context/DynamicContext/DynamicContext.js';
|
|
22
|
+
import '../../../events/dynamicEvents.js';
|
|
23
|
+
import 'react-dom';
|
|
24
|
+
import '../../../config/ApiEndpoint.js';
|
|
25
|
+
import '../../../context/ThemeContext/ThemeContext.js';
|
|
26
|
+
import '@dynamic-labs/types';
|
|
27
|
+
import '../../../context/ErrorContext/ErrorContext.js';
|
|
28
|
+
import '../../../context/AccountExistsContext/AccountExistsContext.js';
|
|
29
|
+
import 'yup';
|
|
30
|
+
import 'react-i18next';
|
|
31
|
+
import '../../../context/MockContext/MockContext.js';
|
|
32
|
+
import '../useUserUpdateRequest/useUpdateUser/useUpdateUser.js';
|
|
33
|
+
import '../../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
34
|
+
import '../../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
35
|
+
import '@dynamic-labs/rpc-providers';
|
|
36
|
+
import '../../../context/UserWalletsContext/UserWalletsContext.js';
|
|
37
|
+
import '../../../components/Alert/Alert.js';
|
|
38
|
+
import '../../../components/ShadowDOM/ShadowDOM.js';
|
|
39
|
+
import '../../../components/IconButton/IconButton.js';
|
|
40
|
+
import '../../../components/InlineWidget/InlineWidget.js';
|
|
41
|
+
import '../../../components/IsBrowser/IsBrowser.js';
|
|
42
|
+
import '../../../components/MenuList/Dropdown/Dropdown.js';
|
|
43
|
+
import '../../../components/Transition/ZoomTransition/ZoomTransition.js';
|
|
44
|
+
import '../../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
|
|
45
|
+
import '../../../components/Transition/OpacityTransition/OpacityTransition.js';
|
|
46
|
+
import '../../../components/Popper/Popper/Popper.js';
|
|
47
|
+
import '../../../components/Popper/PopperContext/PopperContext.js';
|
|
48
|
+
import 'react-focus-lock';
|
|
49
|
+
import 'qrcode';
|
|
50
|
+
import 'formik';
|
|
51
|
+
import 'i18next';
|
|
52
|
+
import '../../../components/OverlayCard/OverlayCard.context.js';
|
|
53
|
+
import '../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js';
|
|
54
|
+
import '../../../context/PasskeyContext/PasskeyContext.js';
|
|
55
|
+
import '../../../views/WalletList/WalletList.js';
|
|
56
|
+
import '../../../context/EmailVerificationContext/EmailVerificationContext.js';
|
|
57
|
+
import '@hcaptcha/react-hcaptcha';
|
|
58
|
+
import '../../../context/CaptchaContext/CaptchaContext.js';
|
|
59
|
+
import '../../../context/LoadingContext/LoadingContext.js';
|
|
60
|
+
import '../../../context/SocialRedirectContext/SocialRedirectContext.js';
|
|
61
|
+
import '../../../context/WalletGroupContext/WalletGroupContext.js';
|
|
62
|
+
import '../../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
|
|
63
|
+
import '../../../context/FooterAnimationContext/index.js';
|
|
64
|
+
import '../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
65
|
+
import '../../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
66
|
+
import '../../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js';
|
|
67
|
+
import '@dynamic-labs/viem-utils';
|
|
68
|
+
import '../../../views/TransactionConfirmationView/helpers/transactionErrorMessage.js';
|
|
69
|
+
import '../useTransactionWithGasPrice/useTransactionWithGasPrice.js';
|
|
70
|
+
import '../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
71
|
+
import { useInternalDynamicContext } from '../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.js';
|
|
72
|
+
|
|
73
|
+
const useNetworkNotSupported = () => {
|
|
74
|
+
const { selectedWalletConnector: walletConnector, setShowAuthFlow, bridgeChainsToConnect, bridgeOnboardingCompleted, } = useInternalDynamicContext();
|
|
75
|
+
const { network: walletConnectorNetwork } = useWalletConnectorNetwork(walletConnector);
|
|
76
|
+
const finishConnectAndSign = useConnectAndSign({
|
|
77
|
+
shouldCallCallback: false,
|
|
78
|
+
shouldUpdateWallets: Boolean(bridgeChainsToConnect === null || bridgeChainsToConnect === void 0 ? void 0 : bridgeChainsToConnect.length),
|
|
79
|
+
});
|
|
80
|
+
// Finishes auth flow when wallet switches to proper network
|
|
81
|
+
useEffect(() => {
|
|
82
|
+
if (!isSupportedNetwork({ network: walletConnectorNetwork, walletConnector })) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
finishConnectAndSign({
|
|
86
|
+
walletConnector: walletConnector,
|
|
87
|
+
});
|
|
88
|
+
// there are two scenarios here, one in not connected state and the other one in connected state.
|
|
89
|
+
// previously we were calling setShowAuthFlow(false) in useHandleWalletsToConnect.
|
|
90
|
+
// now, we don't call it in network-not-supported view, so we need to handle that scenario and close modal here
|
|
91
|
+
// this should be gone, once we're done with the useConnectAndSign hook refactor.
|
|
92
|
+
// TODO: https://linear.app/dynamic-labs/issue/QNTM-117/break-useconnectandsign-hook-to-small-parts
|
|
93
|
+
if (bridgeOnboardingCompleted) {
|
|
94
|
+
setShowAuthFlow(false);
|
|
95
|
+
}
|
|
96
|
+
}, [walletConnectorNetwork, setShowAuthFlow, bridgeOnboardingCompleted]);
|
|
97
|
+
return { currentNetwork: walletConnectorNetwork };
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export { useNetworkNotSupported };
|
|
@@ -69,6 +69,11 @@ const useUserDataForm = ({ onSubmit, onError, userProfile, shouldEnforcePolicies
|
|
|
69
69
|
if (e instanceof utils.EmailAlreadyExistsError) {
|
|
70
70
|
formikHelper.setErrors({ email: 'Email already exists' });
|
|
71
71
|
}
|
|
72
|
+
else if (e instanceof utils.TooManyEmailVerificationsError) {
|
|
73
|
+
formikHelper.setErrors({
|
|
74
|
+
email: 'Too many email verification attempts.',
|
|
75
|
+
});
|
|
76
|
+
}
|
|
72
77
|
else if (e instanceof utils.UsernameAlreadyExistsError) {
|
|
73
78
|
formikHelper.setErrors({ username: 'Username already exists' });
|
|
74
79
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
2
2
|
import { useState, useMemo, useCallback } from 'react';
|
|
3
3
|
import { object } from 'yup';
|
|
4
|
-
import { DynamicError, EmailAlreadyExistsError, UsernameAlreadyExistsError } from '@dynamic-labs/utils';
|
|
4
|
+
import { DynamicError, EmailAlreadyExistsError, TooManyEmailVerificationsError, UsernameAlreadyExistsError } from '@dynamic-labs/utils';
|
|
5
5
|
import '@dynamic-labs/sdk-api';
|
|
6
6
|
import { logger } from '../../../shared/logger.js';
|
|
7
7
|
import '@dynamic-labs/iconic';
|
|
@@ -65,6 +65,11 @@ const useUserDataForm = ({ onSubmit, onError, userProfile, shouldEnforcePolicies
|
|
|
65
65
|
if (e instanceof EmailAlreadyExistsError) {
|
|
66
66
|
formikHelper.setErrors({ email: 'Email already exists' });
|
|
67
67
|
}
|
|
68
|
+
else if (e instanceof TooManyEmailVerificationsError) {
|
|
69
|
+
formikHelper.setErrors({
|
|
70
|
+
email: 'Too many email verification attempts.',
|
|
71
|
+
});
|
|
72
|
+
}
|
|
68
73
|
else if (e instanceof UsernameAlreadyExistsError) {
|
|
69
74
|
formikHelper.setErrors({ username: 'Username already exists' });
|
|
70
75
|
}
|
|
@@ -22,15 +22,14 @@ require('../../shared/utils/classes/storage/localStorage.cjs');
|
|
|
22
22
|
require('viem');
|
|
23
23
|
require('../../shared/consts/index.cjs');
|
|
24
24
|
var useInternalDynamicContext = require('../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.cjs');
|
|
25
|
-
|
|
25
|
+
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
26
26
|
require('../../context/ErrorContext/ErrorContext.cjs');
|
|
27
|
-
require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
28
|
-
require('../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
29
|
-
require('../../config/ApiEndpoint.cjs');
|
|
30
27
|
require('@dynamic-labs/multi-wallet');
|
|
31
28
|
var isSupportedNetwork = require('../../utils/functions/isSupportedNetwork/isSupportedNetwork.cjs');
|
|
32
29
|
require('viem/chains');
|
|
33
|
-
require('../../context/
|
|
30
|
+
require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
31
|
+
require('../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
32
|
+
require('../../config/ApiEndpoint.cjs');
|
|
34
33
|
require('../../context/EmailVerificationContext/EmailVerificationContext.cjs');
|
|
35
34
|
require('react-dom');
|
|
36
35
|
require('../../context/ThemeContext/ThemeContext.cjs');
|
|
@@ -66,7 +65,7 @@ require('@dynamic-labs/viem-utils');
|
|
|
66
65
|
require('../TransactionConfirmationView/helpers/transactionErrorMessage.cjs');
|
|
67
66
|
require('../../utils/hooks/useTransactionWithGasPrice/useTransactionWithGasPrice.cjs');
|
|
68
67
|
require('../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
69
|
-
var
|
|
68
|
+
var useNetworkNotSupported = require('../../utils/hooks/useNetworkNotSupported/useNetworkNotSupported.cjs');
|
|
70
69
|
require('../../components/InlineWidget/InlineWidget.cjs');
|
|
71
70
|
require('../../components/IsBrowser/IsBrowser.cjs');
|
|
72
71
|
require('../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
@@ -81,31 +80,10 @@ var SelectNetworkButton = require('../../components/SelectNetworkButton/SelectNe
|
|
|
81
80
|
require('../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
|
|
82
81
|
|
|
83
82
|
const NetworkNotSupported = () => {
|
|
84
|
-
const { onboardingImageUrl, selectedWalletConnector: walletConnector
|
|
83
|
+
const { onboardingImageUrl, selectedWalletConnector: walletConnector } = useInternalDynamicContext.useInternalDynamicContext();
|
|
85
84
|
const { t } = reactI18next.useTranslation();
|
|
86
|
-
const {
|
|
87
|
-
const finishConnectAndSign = useConnectAndSign.useConnectAndSign({
|
|
88
|
-
shouldCallCallback: false,
|
|
89
|
-
shouldUpdateWallets: !isFullyConnected ||
|
|
90
|
-
(isFullyConnected && Boolean(bridgeChainsToConnect === null || bridgeChainsToConnect === void 0 ? void 0 : bridgeChainsToConnect.length)),
|
|
91
|
-
});
|
|
85
|
+
const { currentNetwork } = useNetworkNotSupported.useNetworkNotSupported();
|
|
92
86
|
const [isNetworkPickerOpen, setIsNetworkPickerOpen] = React.useState(false);
|
|
93
|
-
// Finishes auth flow when wallet switches to proper network
|
|
94
|
-
React.useEffect(() => {
|
|
95
|
-
if (isSupportedNetwork.isSupportedNetwork({ network: walletConnectorNetwork, walletConnector })) {
|
|
96
|
-
finishConnectAndSign({
|
|
97
|
-
walletConnector: walletConnector,
|
|
98
|
-
});
|
|
99
|
-
// there are two scenarios here, one in not connected state and the other one in connected state.
|
|
100
|
-
// previously we were calling setShowAuthFlow(false) in useHandleWalletsToConnect.
|
|
101
|
-
// now, we don't call it in network-not-supported view, so we need to handle that scenario and close modal here
|
|
102
|
-
// this should be gone, once we're done with the useConnectAndSign hook refactor.
|
|
103
|
-
// TODO: https://linear.app/dynamic-labs/issue/QNTM-117/break-useconnectandsign-hook-to-small-parts
|
|
104
|
-
if (isFullyConnected) {
|
|
105
|
-
setShowAuthFlow(false);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}, [walletConnectorNetwork, setShowAuthFlow, isFullyConnected]);
|
|
109
87
|
if (!walletConnector) {
|
|
110
88
|
return null;
|
|
111
89
|
}
|
|
@@ -121,12 +99,12 @@ const NetworkNotSupported = () => {
|
|
|
121
99
|
});
|
|
122
100
|
const evmNetworks = walletConnector.evmNetworks || [];
|
|
123
101
|
const _isSupportedNetwork = isSupportedNetwork.isSupportedNetwork({
|
|
124
|
-
network:
|
|
102
|
+
network: currentNetwork,
|
|
125
103
|
walletConnector,
|
|
126
104
|
});
|
|
127
105
|
return (jsxRuntime.jsxs("div", { className: 'network-not-supported', "data-testid": 'network-not-supported', children: [onboardingImageUrl && (jsxRuntime.jsx("img", { className: 'network-not-supported__main-img', src: onboardingImageUrl, alt: 'onboarding' })), !_isSupportedNetwork && (jsxRuntime.jsx(ErrorContainer.ErrorContainer, { variant: 'info', withIcon: false, className: 'network-not-supported__error--not-supported', copykey: 'dyn_network_not_supported.warning_message', children: t('dyn_network_not_supported.warning_message') })), jsxRuntime.jsxs("div", { className: classNames.classNames('network-not-supported__content-container', {
|
|
128
106
|
'network-not-supported__content-container--error': !_isSupportedNetwork,
|
|
129
|
-
}), children: [jsxRuntime.jsx("div", { className: 'network-not-supported__img-container', children: jsxRuntime.jsx(walletBook.WalletIcon, { style: { height: 64, width: 64 }, walletKey: walletConnector.key }) }), jsxRuntime.jsx(UserAddress.UserAddress, { walletConnector: walletConnector }), jsxRuntime.jsx("div", { className: 'network-not-supported__network-container', children: evmNetworks.length > 1 && (jsxRuntime.jsx(NetworkPicker.NetworkPicker, { currentNetwork:
|
|
107
|
+
}), children: [jsxRuntime.jsx("div", { className: 'network-not-supported__img-container', children: jsxRuntime.jsx(walletBook.WalletIcon, { style: { height: 64, width: 64 }, walletKey: walletConnector.key }) }), jsxRuntime.jsx(UserAddress.UserAddress, { walletConnector: walletConnector }), jsxRuntime.jsx("div", { className: 'network-not-supported__network-container', children: evmNetworks.length > 1 && (jsxRuntime.jsx(NetworkPicker.NetworkPicker, { currentNetwork: currentNetwork, evmNetworks: evmNetworks, connector: walletConnector, isNetworkPickerOpen: isNetworkPickerOpen, setIsNetworkPickerOpen: setIsNetworkPickerOpen, showNetworkName: true, buttonClassName: 'network-not-supported__network-picker-button', mainClassName: 'network-not-supported__network-picker' })) }), jsxRuntime.jsx("div", { className: 'network-not-supported__welcome-container', children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_network_not_supported.subtitle', children: t('dyn_network_not_supported.subtitle') }) }), evmNetworks.length === 1 && (jsxRuntime.jsx(SelectNetworkButton.SelectNetworkButton, { onClick: onSelectNetworkButtonClick, networkId: evmNetworks[0].networkId, networkName: evmNetworks[0].vanityName || evmNetworks[0].name, networkIconUrl: evmNetworks[0].iconUrls[0] }))] })] }));
|
|
130
108
|
};
|
|
131
109
|
|
|
132
110
|
exports.NetworkNotSupported = NetworkNotSupported;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __awaiter } from '../../../../_virtual/_tslib.js';
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { useState
|
|
3
|
+
import { useState } from 'react';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
5
|
import { WalletIcon } from '@dynamic-labs/wallet-book';
|
|
6
6
|
import { classNames } from '../../utils/functions/classNames/classNames.js';
|
|
@@ -18,15 +18,14 @@ import '../../shared/utils/classes/storage/localStorage.js';
|
|
|
18
18
|
import 'viem';
|
|
19
19
|
import '../../shared/consts/index.js';
|
|
20
20
|
import { useInternalDynamicContext } from '../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.js';
|
|
21
|
-
import
|
|
21
|
+
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
22
22
|
import '../../context/ErrorContext/ErrorContext.js';
|
|
23
|
-
import '../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
24
|
-
import '../../context/AccountExistsContext/AccountExistsContext.js';
|
|
25
|
-
import '../../config/ApiEndpoint.js';
|
|
26
23
|
import '@dynamic-labs/multi-wallet';
|
|
27
24
|
import { isSupportedNetwork } from '../../utils/functions/isSupportedNetwork/isSupportedNetwork.js';
|
|
28
25
|
import 'viem/chains';
|
|
29
|
-
import '../../context/
|
|
26
|
+
import '../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
27
|
+
import '../../context/AccountExistsContext/AccountExistsContext.js';
|
|
28
|
+
import '../../config/ApiEndpoint.js';
|
|
30
29
|
import '../../context/EmailVerificationContext/EmailVerificationContext.js';
|
|
31
30
|
import 'react-dom';
|
|
32
31
|
import '../../context/ThemeContext/ThemeContext.js';
|
|
@@ -62,7 +61,7 @@ import '@dynamic-labs/viem-utils';
|
|
|
62
61
|
import '../TransactionConfirmationView/helpers/transactionErrorMessage.js';
|
|
63
62
|
import '../../utils/hooks/useTransactionWithGasPrice/useTransactionWithGasPrice.js';
|
|
64
63
|
import '../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
65
|
-
import {
|
|
64
|
+
import { useNetworkNotSupported } from '../../utils/hooks/useNetworkNotSupported/useNetworkNotSupported.js';
|
|
66
65
|
import '../../components/InlineWidget/InlineWidget.js';
|
|
67
66
|
import '../../components/IsBrowser/IsBrowser.js';
|
|
68
67
|
import '../../components/MenuList/Dropdown/Dropdown.js';
|
|
@@ -77,31 +76,10 @@ import { SelectNetworkButton } from '../../components/SelectNetworkButton/Select
|
|
|
77
76
|
import '../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
|
|
78
77
|
|
|
79
78
|
const NetworkNotSupported = () => {
|
|
80
|
-
const { onboardingImageUrl, selectedWalletConnector: walletConnector
|
|
79
|
+
const { onboardingImageUrl, selectedWalletConnector: walletConnector } = useInternalDynamicContext();
|
|
81
80
|
const { t } = useTranslation();
|
|
82
|
-
const {
|
|
83
|
-
const finishConnectAndSign = useConnectAndSign({
|
|
84
|
-
shouldCallCallback: false,
|
|
85
|
-
shouldUpdateWallets: !isFullyConnected ||
|
|
86
|
-
(isFullyConnected && Boolean(bridgeChainsToConnect === null || bridgeChainsToConnect === void 0 ? void 0 : bridgeChainsToConnect.length)),
|
|
87
|
-
});
|
|
81
|
+
const { currentNetwork } = useNetworkNotSupported();
|
|
88
82
|
const [isNetworkPickerOpen, setIsNetworkPickerOpen] = useState(false);
|
|
89
|
-
// Finishes auth flow when wallet switches to proper network
|
|
90
|
-
useEffect(() => {
|
|
91
|
-
if (isSupportedNetwork({ network: walletConnectorNetwork, walletConnector })) {
|
|
92
|
-
finishConnectAndSign({
|
|
93
|
-
walletConnector: walletConnector,
|
|
94
|
-
});
|
|
95
|
-
// there are two scenarios here, one in not connected state and the other one in connected state.
|
|
96
|
-
// previously we were calling setShowAuthFlow(false) in useHandleWalletsToConnect.
|
|
97
|
-
// now, we don't call it in network-not-supported view, so we need to handle that scenario and close modal here
|
|
98
|
-
// this should be gone, once we're done with the useConnectAndSign hook refactor.
|
|
99
|
-
// TODO: https://linear.app/dynamic-labs/issue/QNTM-117/break-useconnectandsign-hook-to-small-parts
|
|
100
|
-
if (isFullyConnected) {
|
|
101
|
-
setShowAuthFlow(false);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}, [walletConnectorNetwork, setShowAuthFlow, isFullyConnected]);
|
|
105
83
|
if (!walletConnector) {
|
|
106
84
|
return null;
|
|
107
85
|
}
|
|
@@ -117,12 +95,12 @@ const NetworkNotSupported = () => {
|
|
|
117
95
|
});
|
|
118
96
|
const evmNetworks = walletConnector.evmNetworks || [];
|
|
119
97
|
const _isSupportedNetwork = isSupportedNetwork({
|
|
120
|
-
network:
|
|
98
|
+
network: currentNetwork,
|
|
121
99
|
walletConnector,
|
|
122
100
|
});
|
|
123
101
|
return (jsxs("div", { className: 'network-not-supported', "data-testid": 'network-not-supported', children: [onboardingImageUrl && (jsx("img", { className: 'network-not-supported__main-img', src: onboardingImageUrl, alt: 'onboarding' })), !_isSupportedNetwork && (jsx(ErrorContainer, { variant: 'info', withIcon: false, className: 'network-not-supported__error--not-supported', copykey: 'dyn_network_not_supported.warning_message', children: t('dyn_network_not_supported.warning_message') })), jsxs("div", { className: classNames('network-not-supported__content-container', {
|
|
124
102
|
'network-not-supported__content-container--error': !_isSupportedNetwork,
|
|
125
|
-
}), children: [jsx("div", { className: 'network-not-supported__img-container', children: jsx(WalletIcon, { style: { height: 64, width: 64 }, walletKey: walletConnector.key }) }), jsx(UserAddress, { walletConnector: walletConnector }), jsx("div", { className: 'network-not-supported__network-container', children: evmNetworks.length > 1 && (jsx(NetworkPicker, { currentNetwork:
|
|
103
|
+
}), children: [jsx("div", { className: 'network-not-supported__img-container', children: jsx(WalletIcon, { style: { height: 64, width: 64 }, walletKey: walletConnector.key }) }), jsx(UserAddress, { walletConnector: walletConnector }), jsx("div", { className: 'network-not-supported__network-container', children: evmNetworks.length > 1 && (jsx(NetworkPicker, { currentNetwork: currentNetwork, evmNetworks: evmNetworks, connector: walletConnector, isNetworkPickerOpen: isNetworkPickerOpen, setIsNetworkPickerOpen: setIsNetworkPickerOpen, showNetworkName: true, buttonClassName: 'network-not-supported__network-picker-button', mainClassName: 'network-not-supported__network-picker' })) }), jsx("div", { className: 'network-not-supported__welcome-container', children: jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_network_not_supported.subtitle', children: t('dyn_network_not_supported.subtitle') }) }), evmNetworks.length === 1 && (jsx(SelectNetworkButton, { onClick: onSelectNetworkButtonClick, networkId: evmNetworks[0].networkId, networkName: evmNetworks[0].vanityName || evmNetworks[0].name, networkIconUrl: evmNetworks[0].iconUrls[0] }))] })] }));
|
|
126
104
|
};
|
|
127
105
|
|
|
128
106
|
export { NetworkNotSupported };
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var React = require('react');
|
|
7
6
|
var reactI18next = require('react-i18next');
|
|
8
7
|
var walletBook = require('@dynamic-labs/wallet-book');
|
|
8
|
+
require('react');
|
|
9
9
|
require('../../events/dynamicEvents.cjs');
|
|
10
10
|
require('../../../../_virtual/_tslib.cjs');
|
|
11
11
|
require('@dynamic-labs/utils');
|
|
@@ -21,17 +21,15 @@ require('../../shared/utils/classes/storage/localStorage.cjs');
|
|
|
21
21
|
require('viem');
|
|
22
22
|
require('../../shared/consts/index.cjs');
|
|
23
23
|
var useInternalDynamicContext = require('../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.cjs');
|
|
24
|
-
|
|
24
|
+
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
25
25
|
require('../../context/ErrorContext/ErrorContext.cjs');
|
|
26
|
-
require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
27
|
-
require('../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
28
|
-
require('../../config/ApiEndpoint.cjs');
|
|
29
26
|
require('@dynamic-labs/multi-wallet');
|
|
30
27
|
var getWalletConnectorNetworks = require('../../utils/functions/getWalletConnectorNetworks/getWalletConnectorNetworks.cjs');
|
|
31
|
-
var isSupportedNetwork = require('../../utils/functions/isSupportedNetwork/isSupportedNetwork.cjs');
|
|
32
28
|
var pixelToRem = require('../../utils/functions/pixelToRem/pixelToRem.cjs');
|
|
33
29
|
require('viem/chains');
|
|
34
|
-
require('../../context/
|
|
30
|
+
require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
31
|
+
require('../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
32
|
+
require('../../config/ApiEndpoint.cjs');
|
|
35
33
|
require('../../context/EmailVerificationContext/EmailVerificationContext.cjs');
|
|
36
34
|
require('react-dom');
|
|
37
35
|
require('../../context/ThemeContext/ThemeContext.cjs');
|
|
@@ -67,7 +65,7 @@ require('@dynamic-labs/viem-utils');
|
|
|
67
65
|
require('../TransactionConfirmationView/helpers/transactionErrorMessage.cjs');
|
|
68
66
|
require('../../utils/hooks/useTransactionWithGasPrice/useTransactionWithGasPrice.cjs');
|
|
69
67
|
require('../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
70
|
-
var
|
|
68
|
+
var useNetworkNotSupported = require('../../utils/hooks/useNetworkNotSupported/useNetworkNotSupported.cjs');
|
|
71
69
|
require('../../components/InlineWidget/InlineWidget.cjs');
|
|
72
70
|
require('../../components/IsBrowser/IsBrowser.cjs');
|
|
73
71
|
require('../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
@@ -82,30 +80,9 @@ require('../../widgets/DynamicBridgeWidget/views/WalletsView/components/Secondar
|
|
|
82
80
|
// as the wallet does not support programmatic network change.
|
|
83
81
|
const NetworkNotSupportedSwitchManual = () => {
|
|
84
82
|
var _a, _b;
|
|
85
|
-
const { user, selectedWalletConnector: walletConnector
|
|
83
|
+
const { user, selectedWalletConnector: walletConnector } = useInternalDynamicContext.useInternalDynamicContext();
|
|
84
|
+
useNetworkNotSupported.useNetworkNotSupported();
|
|
86
85
|
const { t } = reactI18next.useTranslation();
|
|
87
|
-
const { network: walletConnectorNetwork } = useWalletConnectorNetwork.useWalletConnectorNetwork(walletConnector);
|
|
88
|
-
const finishConnectAndSign = useConnectAndSign.useConnectAndSign({
|
|
89
|
-
shouldCallCallback: false,
|
|
90
|
-
shouldUpdateWallets: !isFullyConnected ||
|
|
91
|
-
(isFullyConnected && Boolean(bridgeChainsToConnect === null || bridgeChainsToConnect === void 0 ? void 0 : bridgeChainsToConnect.length)),
|
|
92
|
-
});
|
|
93
|
-
// Finishes auth flow when wallet switches to proper network
|
|
94
|
-
React.useEffect(() => {
|
|
95
|
-
if (isSupportedNetwork.isSupportedNetwork({ network: walletConnectorNetwork, walletConnector })) {
|
|
96
|
-
finishConnectAndSign({
|
|
97
|
-
walletConnector: walletConnector,
|
|
98
|
-
});
|
|
99
|
-
// there are two scenarios here, one in not connected state and the other one in connected state.
|
|
100
|
-
// previously we were calling setShowAuthFlow(false) in useHandleWalletsToConnect.
|
|
101
|
-
// now, we don't call it in network-not-supported view, so we need to handle that scenario and close modal here
|
|
102
|
-
// this should be gone, once we're done with the useConnectAndSign hook refactor.
|
|
103
|
-
// TODO: https://linear.app/dynamic-labs/issue/QNTM-117/break-useconnectandsign-hook-to-small-parts
|
|
104
|
-
if (isFullyConnected) {
|
|
105
|
-
setShowAuthFlow(false);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}, [walletConnectorNetwork, setShowAuthFlow, isFullyConnected]);
|
|
109
86
|
const iconSize = 80;
|
|
110
87
|
const icon = (jsxRuntime.jsx(walletBook.WalletIcon, { walletKey: walletConnector === null || walletConnector === void 0 ? void 0 : walletConnector.key, style: {
|
|
111
88
|
height: pixelToRem.pixelToRem(iconSize * IconWithSpinner.iconRatio),
|