@dynamic-labs/sdk-react-core 0.19.0-alpha.15 → 0.19.0-alpha.16
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 +23 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +8 -8
- package/src/lib/components/SendBalanceForm/SendBalanceForm.cjs +46 -26
- package/src/lib/components/SendBalanceForm/SendBalanceForm.d.ts +1 -0
- package/src/lib/components/SendBalanceForm/SendBalanceForm.js +46 -26
- package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.cjs +2 -2
- package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.d.ts +1 -0
- package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.js +2 -2
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.cjs +1 -1
- package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.js +1 -1
- package/src/lib/context/DynamicContext/DynamicContext.cjs +20 -7
- package/src/lib/context/DynamicContext/DynamicContext.js +20 -7
- package/src/lib/context/DynamicContext/handleDisconnectWallet/handleDisconnectWallet.cjs +34 -0
- package/src/lib/context/DynamicContext/handleDisconnectWallet/handleDisconnectWallet.d.ts +13 -0
- package/src/lib/context/DynamicContext/handleDisconnectWallet/handleDisconnectWallet.js +30 -0
- package/src/lib/context/DynamicContext/handleDisconnectWallet/index.d.ts +1 -0
- package/src/lib/context/DynamicContext/useCustomerCallbacks/types.d.ts +5 -2
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerCallbacks.cjs +11 -2
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerCallbacks.d.ts +1 -1
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerCallbacks.js +11 -2
- package/src/lib/context/ViewContext/ViewContext.d.ts +1 -1
- package/src/lib/locale/en/translation.cjs +0 -7
- package/src/lib/locale/en/translation.js +1 -7
- package/src/lib/shared/types/index.d.ts +6 -0
- package/src/lib/shared/utils/functions/getWalletListItemLabel/getWalletListItemLabel.cjs +4 -3
- package/src/lib/shared/utils/functions/getWalletListItemLabel/getWalletListItemLabel.js +4 -3
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/functions/getOrdinalNumber/getOrdinalNumber.cjs +21 -0
- package/src/lib/utils/functions/getOrdinalNumber/getOrdinalNumber.d.ts +1 -0
- package/src/lib/utils/functions/getOrdinalNumber/getOrdinalNumber.js +17 -0
- package/src/lib/utils/functions/getOrdinalNumber/index.d.ts +1 -0
- package/src/lib/utils/functions/index.d.ts +1 -0
- package/src/lib/utils/functions/isTestnet/isTestnet.cjs +1 -1
- package/src/lib/utils/functions/isTestnet/isTestnet.js +1 -1
- package/src/lib/utils/functions/sendTransactionWithAutoNonce/sendTransactionWithAutoNonce.cjs +1 -1
- package/src/lib/utils/functions/sendTransactionWithAutoNonce/sendTransactionWithAutoNonce.js +1 -1
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.cjs +1 -1
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSign/useConnectAndSign.js +1 -1
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.cjs +1 -1
- package/src/lib/utils/hooks/authenticationHooks/useConnectAndSignSplitSteps/useConnectAndSignSplitSteps.js +1 -1
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs +0 -1
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js +0 -1
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +5 -2
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.d.ts +5 -4
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +5 -2
- package/src/lib/utils/hooks/useHandleWalletsToConnect/useHandleWalletsToConnect.d.ts +1 -1
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +1 -1
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +1 -1
- package/src/lib/views/PasskeyIntroView/PasskeyIntroView.cjs +9 -4
- package/src/lib/views/PasskeyIntroView/PasskeyIntroView.js +9 -4
- package/src/lib/views/SendBalanceView/SendBalanceView.cjs +3 -2
- package/src/lib/views/SendBalanceView/SendBalanceView.js +3 -2
- package/src/lib/views/viewToComponentMap.cjs +0 -2
- package/src/lib/views/viewToComponentMap.js +0 -2
- package/src/lib/views/PasskeySuccessView/PasskeySuccessView.cjs +0 -71
- package/src/lib/views/PasskeySuccessView/PasskeySuccessView.d.ts +0 -2
- package/src/lib/views/PasskeySuccessView/PasskeySuccessView.js +0 -67
- package/src/lib/views/PasskeySuccessView/index.d.ts +0 -1
|
@@ -19,7 +19,7 @@ require('@dynamic-labs/multi-wallet');
|
|
|
19
19
|
var getAuthToken = require('../../../utils/functions/getAuthToken/getAuthToken.cjs');
|
|
20
20
|
var isConnectOnly = require('../../../utils/hooks/authenticationHooks/helpers/isConnectOnly.cjs');
|
|
21
21
|
|
|
22
|
-
const useCustomerCallbacks = ({ callbacks: { onAuthSuccess, onLinkSuccess, onUserProfileUpdate, onConnectSuccess, onBeforeConnectSuccessConfirmation, onEmailVerificationFailure, onEmailVerificationSuccess, }, handleLogOut, primaryWallet, selectedWalletConnector, user, isAuthenticated, authMode, setIsVerificationInProgress, }) => {
|
|
22
|
+
const useCustomerCallbacks = ({ callbacks: { onAuthSuccess, onLinkSuccess, onUserProfileUpdate, onConnectSuccess, onBeforeConnectSuccessConfirmation, onEmailVerificationFailure, onEmailVerificationSuccess, onEmbeddedWalletCreated, }, handleLogOut, primaryWallet, selectedWalletConnector, user, isAuthenticated, authMode, setIsVerificationInProgress, }) => {
|
|
23
23
|
const [callbackQueue, setCallbackQueue] = React.useState([]);
|
|
24
24
|
const isConnectOnlyAndCallbackIsConnectSuccess = React.useCallback((next) => isConnectOnly.isConnectOnly(user, authMode) &&
|
|
25
25
|
Boolean(primaryWallet) &&
|
|
@@ -53,7 +53,7 @@ const useCustomerCallbacks = ({ callbacks: { onAuthSuccess, onLinkSuccess, onUse
|
|
|
53
53
|
setIsVerificationInProgress,
|
|
54
54
|
]);
|
|
55
55
|
const handleNextCallback = React.useCallback((next, authToken, user) => {
|
|
56
|
-
var _a, _b, _c, _d;
|
|
56
|
+
var _a, _b, _c, _d, _e;
|
|
57
57
|
switch (next === null || next === void 0 ? void 0 : next.callback) {
|
|
58
58
|
case 'authSuccess': {
|
|
59
59
|
try {
|
|
@@ -113,6 +113,15 @@ const useCustomerCallbacks = ({ callbacks: { onAuthSuccess, onLinkSuccess, onUse
|
|
|
113
113
|
catch (e) {
|
|
114
114
|
logger.logger.error('Error calling userProfileUpdate: ', e);
|
|
115
115
|
}
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
118
|
+
case 'embeddedWalletCreated': {
|
|
119
|
+
try {
|
|
120
|
+
onEmbeddedWalletCreated === null || onEmbeddedWalletCreated === void 0 ? void 0 : onEmbeddedWalletCreated((_e = next.params) === null || _e === void 0 ? void 0 : _e.verifiedCredential);
|
|
121
|
+
}
|
|
122
|
+
catch (e) {
|
|
123
|
+
logger.logger.error('Error calling onEmbeddedWalletCreated: ', e);
|
|
124
|
+
}
|
|
116
125
|
}
|
|
117
126
|
}
|
|
118
127
|
}, [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { SetCallbackType, UseCustomerCallbacksArgs } from './types';
|
|
2
|
-
export declare const useCustomerCallbacks: ({ callbacks: { onAuthSuccess, onLinkSuccess, onUserProfileUpdate, onConnectSuccess, onBeforeConnectSuccessConfirmation, onEmailVerificationFailure, onEmailVerificationSuccess, }, handleLogOut, primaryWallet, selectedWalletConnector, user, isAuthenticated, authMode, setIsVerificationInProgress, }: UseCustomerCallbacksArgs) => {
|
|
2
|
+
export declare const useCustomerCallbacks: ({ callbacks: { onAuthSuccess, onLinkSuccess, onUserProfileUpdate, onConnectSuccess, onBeforeConnectSuccessConfirmation, onEmailVerificationFailure, onEmailVerificationSuccess, onEmbeddedWalletCreated, }, handleLogOut, primaryWallet, selectedWalletConnector, user, isAuthenticated, authMode, setIsVerificationInProgress, }: UseCustomerCallbacksArgs) => {
|
|
3
3
|
setCallback: SetCallbackType;
|
|
4
4
|
};
|
|
@@ -15,7 +15,7 @@ import '@dynamic-labs/multi-wallet';
|
|
|
15
15
|
import { getAuthToken } from '../../../utils/functions/getAuthToken/getAuthToken.js';
|
|
16
16
|
import { isConnectOnly } from '../../../utils/hooks/authenticationHooks/helpers/isConnectOnly.js';
|
|
17
17
|
|
|
18
|
-
const useCustomerCallbacks = ({ callbacks: { onAuthSuccess, onLinkSuccess, onUserProfileUpdate, onConnectSuccess, onBeforeConnectSuccessConfirmation, onEmailVerificationFailure, onEmailVerificationSuccess, }, handleLogOut, primaryWallet, selectedWalletConnector, user, isAuthenticated, authMode, setIsVerificationInProgress, }) => {
|
|
18
|
+
const useCustomerCallbacks = ({ callbacks: { onAuthSuccess, onLinkSuccess, onUserProfileUpdate, onConnectSuccess, onBeforeConnectSuccessConfirmation, onEmailVerificationFailure, onEmailVerificationSuccess, onEmbeddedWalletCreated, }, handleLogOut, primaryWallet, selectedWalletConnector, user, isAuthenticated, authMode, setIsVerificationInProgress, }) => {
|
|
19
19
|
const [callbackQueue, setCallbackQueue] = useState([]);
|
|
20
20
|
const isConnectOnlyAndCallbackIsConnectSuccess = useCallback((next) => isConnectOnly(user, authMode) &&
|
|
21
21
|
Boolean(primaryWallet) &&
|
|
@@ -49,7 +49,7 @@ const useCustomerCallbacks = ({ callbacks: { onAuthSuccess, onLinkSuccess, onUse
|
|
|
49
49
|
setIsVerificationInProgress,
|
|
50
50
|
]);
|
|
51
51
|
const handleNextCallback = useCallback((next, authToken, user) => {
|
|
52
|
-
var _a, _b, _c, _d;
|
|
52
|
+
var _a, _b, _c, _d, _e;
|
|
53
53
|
switch (next === null || next === void 0 ? void 0 : next.callback) {
|
|
54
54
|
case 'authSuccess': {
|
|
55
55
|
try {
|
|
@@ -109,6 +109,15 @@ const useCustomerCallbacks = ({ callbacks: { onAuthSuccess, onLinkSuccess, onUse
|
|
|
109
109
|
catch (e) {
|
|
110
110
|
logger.error('Error calling userProfileUpdate: ', e);
|
|
111
111
|
}
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
case 'embeddedWalletCreated': {
|
|
115
|
+
try {
|
|
116
|
+
onEmbeddedWalletCreated === null || onEmbeddedWalletCreated === void 0 ? void 0 : onEmbeddedWalletCreated((_e = next.params) === null || _e === void 0 ? void 0 : _e.verifiedCredential);
|
|
117
|
+
}
|
|
118
|
+
catch (e) {
|
|
119
|
+
logger.error('Error calling onEmbeddedWalletCreated: ', e);
|
|
120
|
+
}
|
|
112
121
|
}
|
|
113
122
|
}
|
|
114
123
|
}, [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SetStateAction, Dispatch, PropsWithChildren, FC } from 'react';
|
|
2
|
-
export type ViewType = 'captcha' | 'chainalysis-blocked-wallet' | 'collect-user-data' | 'collect-user-data-login-with-email' | 'login-with-email-or-wallet-full-wallet-list' | 'login-with-email-or-wallet' | 'login-with-wallet-only' | 'login-with-email-verification' | 'network-not-supported' | 'network-not-supported-manual' | 'no-access' | 'no-qr-not-installed' | 'pending-connect' | 'pending-signature-without-back-button' | 'pending-signature' | 'qr-code' | 'update-email' | 'verify-email' | 'wallet-connect-mobile-wallets-list' | 'wallet-list' | 'multi-wallet-wallet-list' | 'wallet-sign' | 'wallet-used' | 'wallet-group' | 'wait-for-email-confirmation-view' | 'email-wallet-otp-verification-view' | 'social-redirect-view' | 'wallet-locked-view' | 'social-wrong-account' | 'gate-blocked-wallet' | 'bridge-welcome' | 'bridge-summary' | 'bridge-next-wallet-connection' | 'account-exists' | 'merge-user-accounts' | 'wallet-cannot-be-transferred' | 'passkey-intro'
|
|
2
|
+
export type ViewType = 'captcha' | 'chainalysis-blocked-wallet' | 'collect-user-data' | 'collect-user-data-login-with-email' | 'login-with-email-or-wallet-full-wallet-list' | 'login-with-email-or-wallet' | 'login-with-wallet-only' | 'login-with-email-verification' | 'network-not-supported' | 'network-not-supported-manual' | 'no-access' | 'no-qr-not-installed' | 'pending-connect' | 'pending-signature-without-back-button' | 'pending-signature' | 'qr-code' | 'update-email' | 'verify-email' | 'wallet-connect-mobile-wallets-list' | 'wallet-list' | 'multi-wallet-wallet-list' | 'wallet-sign' | 'wallet-used' | 'wallet-group' | 'wait-for-email-confirmation-view' | 'email-wallet-otp-verification-view' | 'social-redirect-view' | 'wallet-locked-view' | 'social-wrong-account' | 'gate-blocked-wallet' | 'bridge-welcome' | 'bridge-summary' | 'bridge-next-wallet-connection' | 'account-exists' | 'merge-user-accounts' | 'wallet-cannot-be-transferred' | 'passkey-intro';
|
|
3
3
|
export type ViewContextProps = {
|
|
4
4
|
setView: Dispatch<SetStateAction<ViewType>>;
|
|
5
5
|
view: ViewType;
|
|
@@ -78,11 +78,6 @@ var dyn_passkey_intro = {
|
|
|
78
78
|
subtitle: "We use Passkeys to keep your account safe. Passkeys are stored natively on your phone and cannot be accessed by anyone besides you.",
|
|
79
79
|
title: "Secure your account"
|
|
80
80
|
};
|
|
81
|
-
var dyn_passkey_success = {
|
|
82
|
-
button: "Continue",
|
|
83
|
-
subtitle: "That was a bit anticlimactic, we know. In the next page, we’ll explain what just happened.",
|
|
84
|
-
title: "That's it! You now have a wallet!"
|
|
85
|
-
};
|
|
86
81
|
var dyn_sign_message = {
|
|
87
82
|
cancel_button: "Cancel",
|
|
88
83
|
sign_button: "Sign",
|
|
@@ -133,7 +128,6 @@ var sdkTranslation = {
|
|
|
133
128
|
dyn_network_not_supported_manual_switch: dyn_network_not_supported_manual_switch,
|
|
134
129
|
dyn_no_access: dyn_no_access,
|
|
135
130
|
dyn_passkey_intro: dyn_passkey_intro,
|
|
136
|
-
dyn_passkey_success: dyn_passkey_success,
|
|
137
131
|
dyn_sign_message: dyn_sign_message,
|
|
138
132
|
dyn_wallet_conect: dyn_wallet_conect,
|
|
139
133
|
dyn_wallet_link: dyn_wallet_link,
|
|
@@ -152,7 +146,6 @@ exports.dyn_network_not_supported = dyn_network_not_supported;
|
|
|
152
146
|
exports.dyn_network_not_supported_manual_switch = dyn_network_not_supported_manual_switch;
|
|
153
147
|
exports.dyn_no_access = dyn_no_access;
|
|
154
148
|
exports.dyn_passkey_intro = dyn_passkey_intro;
|
|
155
|
-
exports.dyn_passkey_success = dyn_passkey_success;
|
|
156
149
|
exports.dyn_sign_message = dyn_sign_message;
|
|
157
150
|
exports.dyn_wallet_conect = dyn_wallet_conect;
|
|
158
151
|
exports.dyn_wallet_link = dyn_wallet_link;
|
|
@@ -74,11 +74,6 @@ var dyn_passkey_intro = {
|
|
|
74
74
|
subtitle: "We use Passkeys to keep your account safe. Passkeys are stored natively on your phone and cannot be accessed by anyone besides you.",
|
|
75
75
|
title: "Secure your account"
|
|
76
76
|
};
|
|
77
|
-
var dyn_passkey_success = {
|
|
78
|
-
button: "Continue",
|
|
79
|
-
subtitle: "That was a bit anticlimactic, we know. In the next page, we’ll explain what just happened.",
|
|
80
|
-
title: "That's it! You now have a wallet!"
|
|
81
|
-
};
|
|
82
77
|
var dyn_sign_message = {
|
|
83
78
|
cancel_button: "Cancel",
|
|
84
79
|
sign_button: "Sign",
|
|
@@ -129,7 +124,6 @@ var sdkTranslation = {
|
|
|
129
124
|
dyn_network_not_supported_manual_switch: dyn_network_not_supported_manual_switch,
|
|
130
125
|
dyn_no_access: dyn_no_access,
|
|
131
126
|
dyn_passkey_intro: dyn_passkey_intro,
|
|
132
|
-
dyn_passkey_success: dyn_passkey_success,
|
|
133
127
|
dyn_sign_message: dyn_sign_message,
|
|
134
128
|
dyn_wallet_conect: dyn_wallet_conect,
|
|
135
129
|
dyn_wallet_link: dyn_wallet_link,
|
|
@@ -138,4 +132,4 @@ var sdkTranslation = {
|
|
|
138
132
|
dyn_widget: dyn_widget
|
|
139
133
|
};
|
|
140
134
|
|
|
141
|
-
export { sdkTranslation as default, dyn_account_exists, dyn_active_wallet_info, dyn_chainalysis_blocked_wallet, dyn_connect_button, dyn_login, dyn_network_not_supported, dyn_network_not_supported_manual_switch, dyn_no_access, dyn_passkey_intro,
|
|
135
|
+
export { sdkTranslation as default, dyn_account_exists, dyn_active_wallet_info, dyn_chainalysis_blocked_wallet, dyn_connect_button, dyn_login, dyn_network_not_supported, dyn_network_not_supported_manual_switch, dyn_no_access, dyn_passkey_intro, dyn_sign_message, dyn_wallet_conect, dyn_wallet_link, dyn_wallet_list, dyn_wallet_transfer, dyn_widget };
|
|
@@ -103,10 +103,14 @@ export type OnAuthSuccess = (params: {
|
|
|
103
103
|
export type OnConnectSuccess = (params: {
|
|
104
104
|
walletConnector: WalletConnector | null;
|
|
105
105
|
}) => void;
|
|
106
|
+
export type OnDisconnect = (params: {
|
|
107
|
+
walletConnector: WalletConnector;
|
|
108
|
+
}) => void;
|
|
106
109
|
export type OnEmailVerificationSuccess = (email: string) => void;
|
|
107
110
|
export type OnEmailVerificationFailure = (email: string) => void;
|
|
108
111
|
export type OnBeforeConnectSuccessConfirmation = (wallet: Partial<Wallet>) => Promise<boolean>;
|
|
109
112
|
export type OnUserProfileUpdate = (user: UserProfile) => void;
|
|
113
|
+
export type OnEmbeddedWalletCreated = (verifiedCredential: JwtVerifiedCredential | undefined) => void;
|
|
110
114
|
export type MultiWalletWidgetState = 'idle' | 'awaiting_account_switch' | 'awaiting_connection' | 'awaiting_signature' | 'detected_new_wallet';
|
|
111
115
|
export type AccountSwitchState = 'idle' | 'linking_new_wallet' | 'switching_primary' | 'primary_not_connected';
|
|
112
116
|
export type AwaitingSignatureState = 'idle' | 'linking_new_wallet' | 'transferring_wallet';
|
|
@@ -153,6 +157,7 @@ export type DynamicEventsCallbacks = {
|
|
|
153
157
|
onAuthFlowOpen?: () => void;
|
|
154
158
|
onAuthSuccess?: OnAuthSuccess;
|
|
155
159
|
onConnectSuccess?: OnConnectSuccess;
|
|
160
|
+
onDisconnect?: OnDisconnect;
|
|
156
161
|
onEmailVerificationSuccess?: OnEmailVerificationSuccess;
|
|
157
162
|
onEmailVerificationFailure?: OnEmailVerificationFailure;
|
|
158
163
|
onBeforeConnectSuccessConfirmation?: OnBeforeConnectSuccessConfirmation;
|
|
@@ -160,6 +165,7 @@ export type DynamicEventsCallbacks = {
|
|
|
160
165
|
onLogout?: (user: UserProfile | undefined) => void;
|
|
161
166
|
onUnlinkSuccess?: (unlinkedWallet: JwtVerifiedCredential) => void;
|
|
162
167
|
onUserProfileUpdate?: (user: UserProfile) => void;
|
|
168
|
+
onEmbeddedWalletCreated?: OnEmbeddedWalletCreated;
|
|
163
169
|
};
|
|
164
170
|
export type AccessDeniedCustomButton = {
|
|
165
171
|
action?: () => void;
|
|
@@ -13,7 +13,8 @@ const comingSoonToMultiWalletDesktop = ['MyAlgo'];
|
|
|
13
13
|
const getLastUsedWalletName = () => localStorage.LocalStorage.getFromLS(localStorage$1.LAST_USED_WALLET);
|
|
14
14
|
const getWalletGroupLabel = (walletGroup) => {
|
|
15
15
|
const lastUsedWalletName = getLastUsedWalletName();
|
|
16
|
-
const hasNestedLastUsedWallet = walletGroup.groupedWallets.some((walletOption) => walletOption.walletConnector.name === lastUsedWalletName
|
|
16
|
+
const hasNestedLastUsedWallet = walletGroup.groupedWallets.some((walletOption) => walletOption.walletConnector.name === lastUsedWalletName ||
|
|
17
|
+
walletOption.walletConnector.key === lastUsedWalletName);
|
|
17
18
|
if (hasNestedLastUsedWallet) {
|
|
18
19
|
return 'Last used';
|
|
19
20
|
}
|
|
@@ -25,13 +26,13 @@ const getWalletGroupLabel = (walletGroup) => {
|
|
|
25
26
|
};
|
|
26
27
|
const getWalletLabel = (walletOption, usingMultiWallet = false) => {
|
|
27
28
|
const lastUsedWalletName = getLastUsedWalletName();
|
|
28
|
-
const { name: walletName } = walletOption.walletConnector;
|
|
29
|
+
const { name: walletName, key: walletKey } = walletOption.walletConnector;
|
|
29
30
|
const isComingSoon = usingMultiWallet &&
|
|
30
31
|
((utils.isMobile() && comingSoonToMultiWalletMobile.includes(walletName)) ||
|
|
31
32
|
(!utils.isMobile() && comingSoonToMultiWalletDesktop.includes(walletName)));
|
|
32
33
|
if (isComingSoon)
|
|
33
34
|
return 'Coming soon';
|
|
34
|
-
const isLastUsedWallet = walletName === lastUsedWalletName;
|
|
35
|
+
const isLastUsedWallet = walletName === lastUsedWalletName || walletKey === lastUsedWalletName;
|
|
35
36
|
if (isLastUsedWallet)
|
|
36
37
|
return 'Last used';
|
|
37
38
|
if (walletOption.isInstalledOnBrowser)
|
|
@@ -9,7 +9,8 @@ const comingSoonToMultiWalletDesktop = ['MyAlgo'];
|
|
|
9
9
|
const getLastUsedWalletName = () => LocalStorage.getFromLS(LAST_USED_WALLET);
|
|
10
10
|
const getWalletGroupLabel = (walletGroup) => {
|
|
11
11
|
const lastUsedWalletName = getLastUsedWalletName();
|
|
12
|
-
const hasNestedLastUsedWallet = walletGroup.groupedWallets.some((walletOption) => walletOption.walletConnector.name === lastUsedWalletName
|
|
12
|
+
const hasNestedLastUsedWallet = walletGroup.groupedWallets.some((walletOption) => walletOption.walletConnector.name === lastUsedWalletName ||
|
|
13
|
+
walletOption.walletConnector.key === lastUsedWalletName);
|
|
13
14
|
if (hasNestedLastUsedWallet) {
|
|
14
15
|
return 'Last used';
|
|
15
16
|
}
|
|
@@ -21,13 +22,13 @@ const getWalletGroupLabel = (walletGroup) => {
|
|
|
21
22
|
};
|
|
22
23
|
const getWalletLabel = (walletOption, usingMultiWallet = false) => {
|
|
23
24
|
const lastUsedWalletName = getLastUsedWalletName();
|
|
24
|
-
const { name: walletName } = walletOption.walletConnector;
|
|
25
|
+
const { name: walletName, key: walletKey } = walletOption.walletConnector;
|
|
25
26
|
const isComingSoon = usingMultiWallet &&
|
|
26
27
|
((isMobile() && comingSoonToMultiWalletMobile.includes(walletName)) ||
|
|
27
28
|
(!isMobile() && comingSoonToMultiWalletDesktop.includes(walletName)));
|
|
28
29
|
if (isComingSoon)
|
|
29
30
|
return 'Coming soon';
|
|
30
|
-
const isLastUsedWallet = walletName === lastUsedWalletName;
|
|
31
|
+
const isLastUsedWallet = walletName === lastUsedWalletName || walletKey === lastUsedWalletName;
|
|
31
32
|
if (isLastUsedWallet)
|
|
32
33
|
return 'Last used';
|
|
33
34
|
if (walletOption.isInstalledOnBrowser)
|