@dynamic-labs/sdk-react-core 0.18.8 → 0.18.9
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 +13 -0
- package/package.cjs +3 -3
- package/package.js +3 -3
- package/package.json +10 -10
- package/src/lib/components/UserProfile/UserProfile.cjs +1 -1
- package/src/lib/components/UserProfile/UserProfile.js +1 -1
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.cjs +1 -1
- package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js +1 -1
- package/src/lib/utils/functions/createUserProfile/createUserProfile.cjs +1 -1
- package/src/lib/utils/functions/createUserProfile/createUserProfile.js +1 -1
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +14 -16
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +15 -17
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.cjs +1 -6
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.js +1 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
|
|
2
|
+
### [0.18.9](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.8...v0.18.9) (2023-08-25)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* register connection of second wallet in bridge ([5c49b72](https://github.com/dynamic-labs/DynamicAuth/commit/5c49b7266a0b89f73a91116b4161185fd2fa8c15)), closes [#3113](https://github.com/dynamic-labs/DynamicAuth/issues/3113)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* fix github social linking icon on dark mode ([#3129](https://github.com/dynamic-labs/DynamicAuth/issues/3129)) ([2ecad53](https://github.com/dynamic-labs/DynamicAuth/commit/2ecad53312baca43b200e17d1df60a61adf31222)), closes [#3126](https://github.com/dynamic-labs/DynamicAuth/issues/3126)
|
|
13
|
+
* fix issue with detecting oauth window closed before finishing linking ([#3127](https://github.com/dynamic-labs/DynamicAuth/issues/3127)) ([8c774cc](https://github.com/dynamic-labs/DynamicAuth/commit/8c774cc7a67784892af5e91244de42f9fd092acc)), closes [#3124](https://github.com/dynamic-labs/DynamicAuth/issues/3124)
|
|
14
|
+
|
|
2
15
|
### [0.18.8](https://github.com/dynamic-labs/DynamicAuth/compare/v0.18.7...v0.18.8) (2023-08-24)
|
|
3
16
|
|
|
4
17
|
|
package/package.cjs
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var version = "0.18.
|
|
5
|
+
var version = "0.18.9";
|
|
6
6
|
var dependencies = {
|
|
7
7
|
"react-focus-lock": "2.9.2",
|
|
8
|
-
"@dynamic-labs/iconic": "0.1.
|
|
9
|
-
"@dynamic-labs/sdk-api": "0.0.
|
|
8
|
+
"@dynamic-labs/iconic": "0.1.27",
|
|
9
|
+
"@dynamic-labs/sdk-api": "0.0.270",
|
|
10
10
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
11
11
|
"country-list": "2.3.0",
|
|
12
12
|
yup: "0.32.11",
|
package/package.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var version = "0.18.
|
|
1
|
+
var version = "0.18.9";
|
|
2
2
|
var dependencies = {
|
|
3
3
|
"react-focus-lock": "2.9.2",
|
|
4
|
-
"@dynamic-labs/iconic": "0.1.
|
|
5
|
-
"@dynamic-labs/sdk-api": "0.0.
|
|
4
|
+
"@dynamic-labs/iconic": "0.1.27",
|
|
5
|
+
"@dynamic-labs/sdk-api": "0.0.270",
|
|
6
6
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
7
7
|
"country-list": "2.3.0",
|
|
8
8
|
yup: "0.32.11",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.9",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
@@ -8,21 +8,21 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"react-focus-lock": "2.9.2",
|
|
11
|
-
"@dynamic-labs/iconic": "0.1.
|
|
12
|
-
"@dynamic-labs/sdk-api": "0.0.
|
|
11
|
+
"@dynamic-labs/iconic": "0.1.27",
|
|
12
|
+
"@dynamic-labs/sdk-api": "0.0.270",
|
|
13
13
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
14
14
|
"country-list": "2.3.0",
|
|
15
15
|
"yup": "0.32.11",
|
|
16
16
|
"formik": "2.2.9",
|
|
17
17
|
"qrcode": "1.5.1",
|
|
18
18
|
"ethers": "5.7.2",
|
|
19
|
-
"@dynamic-labs/logger": "0.18.
|
|
20
|
-
"@dynamic-labs/multi-wallet": "0.18.
|
|
21
|
-
"@dynamic-labs/rpc-providers": "0.18.
|
|
22
|
-
"@dynamic-labs/types": "0.18.
|
|
23
|
-
"@dynamic-labs/utils": "0.18.
|
|
24
|
-
"@dynamic-labs/wallet-book": "0.18.
|
|
25
|
-
"@dynamic-labs/wallet-connector-core": "0.18.
|
|
19
|
+
"@dynamic-labs/logger": "0.18.9",
|
|
20
|
+
"@dynamic-labs/multi-wallet": "0.18.9",
|
|
21
|
+
"@dynamic-labs/rpc-providers": "0.18.9",
|
|
22
|
+
"@dynamic-labs/types": "0.18.9",
|
|
23
|
+
"@dynamic-labs/utils": "0.18.9",
|
|
24
|
+
"@dynamic-labs/wallet-book": "0.18.9",
|
|
25
|
+
"@dynamic-labs/wallet-connector-core": "0.18.9",
|
|
26
26
|
"eventemitter3": "5.0.1"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
@@ -43,7 +43,7 @@ const UserProfile = ({ rootClassName }) => {
|
|
|
43
43
|
const { label } = index$1.getValueByKey(fieldsConfig.fieldsConfig, name);
|
|
44
44
|
const value = mapFieldKeyToValue(name);
|
|
45
45
|
return (jsxRuntime.jsx(UserProfileField.UserProfileField, { name: name, label: label, value: value }, name));
|
|
46
|
-
}) })) }))), (providers === null || providers === void 0 ? void 0 : providers.length) > 0 && (jsxRuntime.jsx(UserProfileSection.UserProfileSection, Object.assign({ title: 'Social accounts' }, { children: jsxRuntime.jsx("div", Object.assign({ className: 'user-profile__social-accounts' }, { children: providers.map(({
|
|
46
|
+
}) })) }))), (providers === null || providers === void 0 ? void 0 : providers.length) > 0 && (jsxRuntime.jsx(UserProfileSection.UserProfileSection, Object.assign({ title: 'Social accounts' }, { children: jsxRuntime.jsx("div", Object.assign({ className: 'user-profile__social-accounts' }, { children: providers.map(({ provider }) => (jsxRuntime.jsx(UserProfileSocialAccount.UserProfileSocialAccount, { provider: provider }, provider))) })) })))] })));
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
exports.UserProfile = UserProfile;
|
|
@@ -39,7 +39,7 @@ const UserProfile = ({ rootClassName }) => {
|
|
|
39
39
|
const { label } = getValueByKey(fieldsConfig, name);
|
|
40
40
|
const value = mapFieldKeyToValue(name);
|
|
41
41
|
return (jsx(UserProfileField, { name: name, label: label, value: value }, name));
|
|
42
|
-
}) })) }))), (providers === null || providers === void 0 ? void 0 : providers.length) > 0 && (jsx(UserProfileSection, Object.assign({ title: 'Social accounts' }, { children: jsx("div", Object.assign({ className: 'user-profile__social-accounts' }, { children: providers.map(({
|
|
42
|
+
}) })) }))), (providers === null || providers === void 0 ? void 0 : providers.length) > 0 && (jsx(UserProfileSection, Object.assign({ title: 'Social accounts' }, { children: jsx("div", Object.assign({ className: 'user-profile__social-accounts' }, { children: providers.map(({ provider }) => (jsx(UserProfileSocialAccount, { provider: provider }, provider))) })) })))] })));
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
export { UserProfile };
|
package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.cjs
CHANGED
|
@@ -57,7 +57,7 @@ const UserProfileSocialAccount = ({ provider, }) => {
|
|
|
57
57
|
const isProviderLinked = isLinked(provider);
|
|
58
58
|
const connectedAccountInfo = getLinkedAccountInformation(provider);
|
|
59
59
|
const iconThemeVariant = useIconThemeVariant.useIconThemeVariant();
|
|
60
|
-
return (jsxRuntime.jsxs("div", Object.assign({ className: 'user-profile-social-account', "data-testid": `social-account-${provider}` }, { children: [jsxRuntime.jsx("div", Object.assign({ className: 'user-profile-social-account__icon' }, { children: isProviderLinked ? (jsxRuntime.jsx(ConnectedAccountAvatar.ConnectedAccountAvatar, { provider: provider, avatarUrl: connectedAccountInfo === null || connectedAccountInfo === void 0 ? void 0 : connectedAccountInfo.avatar
|
|
60
|
+
return (jsxRuntime.jsxs("div", Object.assign({ className: 'user-profile-social-account', "data-testid": `social-account-${provider}` }, { children: [jsxRuntime.jsx("div", Object.assign({ className: 'user-profile-social-account__icon' }, { children: isProviderLinked ? (jsxRuntime.jsx(ConnectedAccountAvatar.ConnectedAccountAvatar, { provider: provider, avatarUrl: connectedAccountInfo === null || connectedAccountInfo === void 0 ? void 0 : connectedAccountInfo.avatar })) : (jsxRuntime.jsx(iconic.SocialIcon, { name: provider, variant: iconThemeVariant })) })), jsxRuntime.jsx("div", Object.assign({ className: 'user-profile-social-account__label' }, { children: jsxRuntime.jsx(Typography.Typography, Object.assign({ weight: 'medium', variant: 'body_normal', color: 'primary' }, { children: (_a = connectedAccountInfo === null || connectedAccountInfo === void 0 ? void 0 : connectedAccountInfo.publicIdentifier) !== null && _a !== void 0 ? _a : helpers.capitalize(provider) })) })), isProviderLinked ? (jsxRuntime.jsx(Button.Button, { buttonClassName: 'user-profile-social-account__button', buttonVariant: 'secondary', buttonRounded: 'small', buttonPadding: 'none', onClick: () => unlinkSocialAccount(provider), loading: isProcessing, dataTestId: 'social-account-disconnect-button', typographyProps: {
|
|
61
61
|
color: 'secondary',
|
|
62
62
|
variant: 'button_tertiary',
|
|
63
63
|
}, startSlot:
|
package/src/lib/components/UserProfile/parts/UserProfileSocialAccount/UserProfileSocialAccount.js
CHANGED
|
@@ -53,7 +53,7 @@ const UserProfileSocialAccount = ({ provider, }) => {
|
|
|
53
53
|
const isProviderLinked = isLinked(provider);
|
|
54
54
|
const connectedAccountInfo = getLinkedAccountInformation(provider);
|
|
55
55
|
const iconThemeVariant = useIconThemeVariant();
|
|
56
|
-
return (jsxs("div", Object.assign({ className: 'user-profile-social-account', "data-testid": `social-account-${provider}` }, { children: [jsx("div", Object.assign({ className: 'user-profile-social-account__icon' }, { children: isProviderLinked ? (jsx(ConnectedAccountAvatar, { provider: provider, avatarUrl: connectedAccountInfo === null || connectedAccountInfo === void 0 ? void 0 : connectedAccountInfo.avatar
|
|
56
|
+
return (jsxs("div", Object.assign({ className: 'user-profile-social-account', "data-testid": `social-account-${provider}` }, { children: [jsx("div", Object.assign({ className: 'user-profile-social-account__icon' }, { children: isProviderLinked ? (jsx(ConnectedAccountAvatar, { provider: provider, avatarUrl: connectedAccountInfo === null || connectedAccountInfo === void 0 ? void 0 : connectedAccountInfo.avatar })) : (jsx(SocialIcon, { name: provider, variant: iconThemeVariant })) })), jsx("div", Object.assign({ className: 'user-profile-social-account__label' }, { children: jsx(Typography, Object.assign({ weight: 'medium', variant: 'body_normal', color: 'primary' }, { children: (_a = connectedAccountInfo === null || connectedAccountInfo === void 0 ? void 0 : connectedAccountInfo.publicIdentifier) !== null && _a !== void 0 ? _a : capitalize(provider) })) })), isProviderLinked ? (jsx(Button, { buttonClassName: 'user-profile-social-account__button', buttonVariant: 'secondary', buttonRounded: 'small', buttonPadding: 'none', onClick: () => unlinkSocialAccount(provider), loading: isProcessing, dataTestId: 'social-account-disconnect-button', typographyProps: {
|
|
57
57
|
color: 'secondary',
|
|
58
58
|
variant: 'button_tertiary',
|
|
59
59
|
}, startSlot:
|
|
@@ -29,7 +29,7 @@ const createUserProfile = (decodedJwt) => {
|
|
|
29
29
|
team: decodedJwt.team,
|
|
30
30
|
username: decodedJwt.username,
|
|
31
31
|
};
|
|
32
|
-
const userProfile = Object.assign({ chain: wallet === null || wallet === void 0 ? void 0 : wallet.chain, ens: wallet === null || wallet === void 0 ? void 0 : wallet.nameService, environmentId: decodedJwt.environmentId, isAuthenticatedWithAWallet: ((_a = index.lastAuthenticatedAccount(decodedJwt)) === null || _a === void 0 ? void 0 : _a.format) === 'blockchain', lastVerifiedCredentialId: decodedJwt.lastVerifiedCredentialId, lists: decodedJwt.lists, newUser: decodedJwt.newUser, scope: decodedJwt.scope, sessionId: decodedJwt.sid, userId: decodedJwt.sub, verifiedCredentials: decodedJwt.verifiedCredentials || [], wallet: wallet === null || wallet === void 0 ? void 0 : wallet.walletName }, kyc);
|
|
32
|
+
const userProfile = Object.assign({ chain: wallet === null || wallet === void 0 ? void 0 : wallet.chain, ens: wallet === null || wallet === void 0 ? void 0 : wallet.nameService, environmentId: decodedJwt.environmentId, isAuthenticatedWithAWallet: ((_a = index.lastAuthenticatedAccount(decodedJwt)) === null || _a === void 0 ? void 0 : _a.format) === 'blockchain', lastVerifiedCredentialId: decodedJwt.lastVerifiedCredentialId, lists: decodedJwt.lists, metadata: decodedJwt.metadata, newUser: decodedJwt.newUser, scope: decodedJwt.scope, sessionId: decodedJwt.sid, userId: decodedJwt.sub, verifiedCredentials: decodedJwt.verifiedCredentials || [], wallet: wallet === null || wallet === void 0 ? void 0 : wallet.walletName }, kyc);
|
|
33
33
|
return userProfile;
|
|
34
34
|
};
|
|
35
35
|
|
|
@@ -25,7 +25,7 @@ const createUserProfile = (decodedJwt) => {
|
|
|
25
25
|
team: decodedJwt.team,
|
|
26
26
|
username: decodedJwt.username,
|
|
27
27
|
};
|
|
28
|
-
const userProfile = Object.assign({ chain: wallet === null || wallet === void 0 ? void 0 : wallet.chain, ens: wallet === null || wallet === void 0 ? void 0 : wallet.nameService, environmentId: decodedJwt.environmentId, isAuthenticatedWithAWallet: ((_a = lastAuthenticatedAccount(decodedJwt)) === null || _a === void 0 ? void 0 : _a.format) === 'blockchain', lastVerifiedCredentialId: decodedJwt.lastVerifiedCredentialId, lists: decodedJwt.lists, newUser: decodedJwt.newUser, scope: decodedJwt.scope, sessionId: decodedJwt.sid, userId: decodedJwt.sub, verifiedCredentials: decodedJwt.verifiedCredentials || [], wallet: wallet === null || wallet === void 0 ? void 0 : wallet.walletName }, kyc);
|
|
28
|
+
const userProfile = Object.assign({ chain: wallet === null || wallet === void 0 ? void 0 : wallet.chain, ens: wallet === null || wallet === void 0 ? void 0 : wallet.nameService, environmentId: decodedJwt.environmentId, isAuthenticatedWithAWallet: ((_a = lastAuthenticatedAccount(decodedJwt)) === null || _a === void 0 ? void 0 : _a.format) === 'blockchain', lastVerifiedCredentialId: decodedJwt.lastVerifiedCredentialId, lists: decodedJwt.lists, metadata: decodedJwt.metadata, newUser: decodedJwt.newUser, scope: decodedJwt.scope, sessionId: decodedJwt.sid, userId: decodedJwt.sub, verifiedCredentials: decodedJwt.verifiedCredentials || [], wallet: wallet === null || wallet === void 0 ? void 0 : wallet.walletName }, kyc);
|
|
29
29
|
return userProfile;
|
|
30
30
|
};
|
|
31
31
|
|
|
@@ -130,8 +130,7 @@ const useConnectWallet = ({ authMode, clearPrimaryWalletId, enableVisitTrackingO
|
|
|
130
130
|
network: currentWalletConnectoNetwork,
|
|
131
131
|
});
|
|
132
132
|
});
|
|
133
|
-
const shouldSkipCreatingVisit =
|
|
134
|
-
connectedWallet, [authMode, connectedWallet, enableVisitTrackingOnConnectOnly]);
|
|
133
|
+
const shouldSkipCreatingVisit = authMode === 'connect-only' && !enableVisitTrackingOnConnectOnly;
|
|
135
134
|
const connectWallet = (walletConnector, fetchPublicAddressOpts, shouldCallCallback = true) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
136
135
|
const publicWalletAddress = yield walletConnector.fetchPublicAddress(fetchPublicAddressOpts);
|
|
137
136
|
if (!publicWalletAddress) {
|
|
@@ -168,21 +167,20 @@ const useConnectWallet = ({ authMode, clearPrimaryWalletId, enableVisitTrackingO
|
|
|
168
167
|
walletConnectorKey: walletConnector.name,
|
|
169
168
|
walletId,
|
|
170
169
|
});
|
|
170
|
+
if (!shouldSkipCreatingVisit) {
|
|
171
|
+
// send information to backend to kick off background jobs
|
|
172
|
+
// so verify/sign on the next step could go by more quickly
|
|
173
|
+
// this is async work, but DO NOT AWAIT
|
|
174
|
+
api.createVisit({
|
|
175
|
+
authMode,
|
|
176
|
+
chain: walletChain || '',
|
|
177
|
+
environmentId,
|
|
178
|
+
publicWalletAddress,
|
|
179
|
+
walletName: walletConnector.name,
|
|
180
|
+
walletProvider: getWalletProvider.getWalletProvider(walletConnector),
|
|
181
|
+
});
|
|
182
|
+
}
|
|
171
183
|
}
|
|
172
|
-
if (shouldSkipCreatingVisit) {
|
|
173
|
-
return Promise.resolve(publicWalletAddress);
|
|
174
|
-
}
|
|
175
|
-
// send information to backend to kick off background jobs
|
|
176
|
-
// so verify/sign on the next step could go by more quickly
|
|
177
|
-
// this is async work, but DO NOT AWAIT
|
|
178
|
-
api.createVisit({
|
|
179
|
-
authMode,
|
|
180
|
-
chain: walletChain || '',
|
|
181
|
-
environmentId,
|
|
182
|
-
publicWalletAddress,
|
|
183
|
-
walletName: walletConnector.name,
|
|
184
|
-
walletProvider: getWalletProvider.getWalletProvider(walletConnector),
|
|
185
|
-
});
|
|
186
184
|
return Promise.resolve(publicWalletAddress);
|
|
187
185
|
});
|
|
188
186
|
const unlinkConnectedWallet = (walletId) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __awaiter } from '../../../../../_virtual/_tslib.js';
|
|
2
|
-
import { useState, useCallback, useEffect
|
|
2
|
+
import { useState, useCallback, useEffect } from 'react';
|
|
3
3
|
import { getWalletConnectorByName, logger } from '@dynamic-labs/wallet-connector-core';
|
|
4
4
|
import '@dynamic-labs/sdk-api';
|
|
5
5
|
import '../../../shared/logger.js';
|
|
@@ -126,8 +126,7 @@ const useConnectWallet = ({ authMode, clearPrimaryWalletId, enableVisitTrackingO
|
|
|
126
126
|
network: currentWalletConnectoNetwork,
|
|
127
127
|
});
|
|
128
128
|
});
|
|
129
|
-
const shouldSkipCreatingVisit =
|
|
130
|
-
connectedWallet, [authMode, connectedWallet, enableVisitTrackingOnConnectOnly]);
|
|
129
|
+
const shouldSkipCreatingVisit = authMode === 'connect-only' && !enableVisitTrackingOnConnectOnly;
|
|
131
130
|
const connectWallet = (walletConnector, fetchPublicAddressOpts, shouldCallCallback = true) => __awaiter(void 0, void 0, void 0, function* () {
|
|
132
131
|
const publicWalletAddress = yield walletConnector.fetchPublicAddress(fetchPublicAddressOpts);
|
|
133
132
|
if (!publicWalletAddress) {
|
|
@@ -164,21 +163,20 @@ const useConnectWallet = ({ authMode, clearPrimaryWalletId, enableVisitTrackingO
|
|
|
164
163
|
walletConnectorKey: walletConnector.name,
|
|
165
164
|
walletId,
|
|
166
165
|
});
|
|
166
|
+
if (!shouldSkipCreatingVisit) {
|
|
167
|
+
// send information to backend to kick off background jobs
|
|
168
|
+
// so verify/sign on the next step could go by more quickly
|
|
169
|
+
// this is async work, but DO NOT AWAIT
|
|
170
|
+
createVisit({
|
|
171
|
+
authMode,
|
|
172
|
+
chain: walletChain || '',
|
|
173
|
+
environmentId,
|
|
174
|
+
publicWalletAddress,
|
|
175
|
+
walletName: walletConnector.name,
|
|
176
|
+
walletProvider: getWalletProvider(walletConnector),
|
|
177
|
+
});
|
|
178
|
+
}
|
|
167
179
|
}
|
|
168
|
-
if (shouldSkipCreatingVisit) {
|
|
169
|
-
return Promise.resolve(publicWalletAddress);
|
|
170
|
-
}
|
|
171
|
-
// send information to backend to kick off background jobs
|
|
172
|
-
// so verify/sign on the next step could go by more quickly
|
|
173
|
-
// this is async work, but DO NOT AWAIT
|
|
174
|
-
createVisit({
|
|
175
|
-
authMode,
|
|
176
|
-
chain: walletChain || '',
|
|
177
|
-
environmentId,
|
|
178
|
-
publicWalletAddress,
|
|
179
|
-
walletName: walletConnector.name,
|
|
180
|
-
walletProvider: getWalletProvider(walletConnector),
|
|
181
|
-
});
|
|
182
180
|
return Promise.resolve(publicWalletAddress);
|
|
183
181
|
});
|
|
184
182
|
const unlinkConnectedWallet = (walletId) => {
|
|
@@ -146,6 +146,7 @@ const useSocialAccounts = ({ sessionTimeout } = {
|
|
|
146
146
|
if (!isValidMessage) {
|
|
147
147
|
return;
|
|
148
148
|
}
|
|
149
|
+
setIsProcessing(true);
|
|
149
150
|
if (!((_c = providersWaitingOauthMessages.current) === null || _c === void 0 ? void 0 : _c[provider])) {
|
|
150
151
|
handleError(`Linking ${provider} account session timeout.`);
|
|
151
152
|
return;
|
|
@@ -200,15 +201,9 @@ const useSocialAccounts = ({ sessionTimeout } = {
|
|
|
200
201
|
if (!providersWithoutWindowOpenerRefence.includes(provider)) {
|
|
201
202
|
// For provider that support window.opener, we need to clear all states/listeners when the window is closed
|
|
202
203
|
authWindowInterval.current = setInterval(() => {
|
|
203
|
-
var _a;
|
|
204
204
|
if (!(authWindow === null || authWindow === void 0 ? void 0 : authWindow.closed)) {
|
|
205
205
|
return;
|
|
206
206
|
}
|
|
207
|
-
// window was closed by user, before completing oauth
|
|
208
|
-
if ((_a = providersWaitingOauthMessages.current) === null || _a === void 0 ? void 0 : _a[provider]) {
|
|
209
|
-
clearListeners();
|
|
210
|
-
handleError(`Linking ${provider} account window closed.`);
|
|
211
|
-
}
|
|
212
207
|
clearInterval(authWindowInterval.current);
|
|
213
208
|
setIsProcessing(false);
|
|
214
209
|
});
|
|
@@ -142,6 +142,7 @@ const useSocialAccounts = ({ sessionTimeout } = {
|
|
|
142
142
|
if (!isValidMessage) {
|
|
143
143
|
return;
|
|
144
144
|
}
|
|
145
|
+
setIsProcessing(true);
|
|
145
146
|
if (!((_c = providersWaitingOauthMessages.current) === null || _c === void 0 ? void 0 : _c[provider])) {
|
|
146
147
|
handleError(`Linking ${provider} account session timeout.`);
|
|
147
148
|
return;
|
|
@@ -196,15 +197,9 @@ const useSocialAccounts = ({ sessionTimeout } = {
|
|
|
196
197
|
if (!providersWithoutWindowOpenerRefence.includes(provider)) {
|
|
197
198
|
// For provider that support window.opener, we need to clear all states/listeners when the window is closed
|
|
198
199
|
authWindowInterval.current = setInterval(() => {
|
|
199
|
-
var _a;
|
|
200
200
|
if (!(authWindow === null || authWindow === void 0 ? void 0 : authWindow.closed)) {
|
|
201
201
|
return;
|
|
202
202
|
}
|
|
203
|
-
// window was closed by user, before completing oauth
|
|
204
|
-
if ((_a = providersWaitingOauthMessages.current) === null || _a === void 0 ? void 0 : _a[provider]) {
|
|
205
|
-
clearListeners();
|
|
206
|
-
handleError(`Linking ${provider} account window closed.`);
|
|
207
|
-
}
|
|
208
203
|
clearInterval(authWindowInterval.current);
|
|
209
204
|
setIsProcessing(false);
|
|
210
205
|
});
|