From 107fb9ba6cd484b7cfd6a39c2050b0a282837fea Mon Sep 17 00:00:00 2001 From: peachbits Date: Wed, 10 Jul 2024 12:00:07 -0700 Subject: [PATCH 1/3] Change enabled tokens after wallets are created --- .../scenes/CreateWalletCompletionScene.tsx | 23 ++++++++----------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/src/components/scenes/CreateWalletCompletionScene.tsx b/src/components/scenes/CreateWalletCompletionScene.tsx index cf4861a4f40..8430fa0dfcb 100644 --- a/src/components/scenes/CreateWalletCompletionScene.tsx +++ b/src/components/scenes/CreateWalletCompletionScene.tsx @@ -73,18 +73,6 @@ const CreateWalletCompletionComponent = (props: Props) => { // Create the wallets and enable the tokens useAsyncEffect( async () => { - // Create tokens on existing wallets: - let tokenPromise: Promise | undefined - if (tokenKey != null) { - tokenPromise = dispatch(enableTokensAcrossWallets(newTokenItems)).then( - () => setItemStatus(currentState => ({ ...currentState, [tokenKey]: 'complete' })), - error => { - showError(error) - setItemStatus(currentState => ({ ...currentState, [tokenKey]: 'error' })) - } - ) - } - // Create new wallets in parallel: const walletResults = await createWallets( account, @@ -115,8 +103,15 @@ const CreateWalletCompletionComponent = (props: Props) => { } } - if (tokenPromise != null) { - await tokenPromise + // Create tokens on existing wallets: + if (tokenKey != null) { + await dispatch(enableTokensAcrossWallets(newTokenItems)).then( + () => setItemStatus(currentState => ({ ...currentState, [tokenKey]: 'complete' })), + error => { + showError(error) + setItemStatus(currentState => ({ ...currentState, [tokenKey]: 'error' })) + } + ) } // Save the created wallets From 40d2fe0de660ecfffab64c7c4daa83e830bdcf77 Mon Sep 17 00:00:00 2001 From: peachbits Date: Wed, 10 Jul 2024 13:47:18 -0700 Subject: [PATCH 2/3] Don't consider the transfer swap plugin when checking for enabled swap partners --- src/actions/SettingsActions.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/actions/SettingsActions.tsx b/src/actions/SettingsActions.tsx index 6e3e62e3992..c6b2adaa633 100644 --- a/src/actions/SettingsActions.tsx +++ b/src/actions/SettingsActions.tsx @@ -29,6 +29,7 @@ export function checkEnabledExchanges(): ThunkAction { const exchanges = account.swapConfig if (exchanges == null) return for (const exchange of Object.keys(exchanges)) { + if (exchange === 'transfer') continue if (exchanges[exchange].enabled) { isAnyExchangeEnabled = true } From 2efb7cc3a887c0a57e167f2526cd54dfdcb81729 Mon Sep 17 00:00:00 2001 From: Matthew Date: Wed, 10 Jul 2024 11:44:41 -0700 Subject: [PATCH 3/3] Don't try to round a text string --- src/actions/WalletActions.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/actions/WalletActions.tsx b/src/actions/WalletActions.tsx index 18edf256f0b..3f58da9163b 100644 --- a/src/actions/WalletActions.tsx +++ b/src/actions/WalletActions.tsx @@ -214,7 +214,7 @@ const activateWalletTokens = async ( const displayFee = div(nativeFee, feeDenom.multiplier, log10(feeDenom.multiplier)) let fiatFee = convertCurrencyFromExchangeRates(state.exchangeRates, paymentCurrencyCode, defaultIsoFiat, exchangeNetworkFee) if (lt(fiatFee, '0.001')) fiatFee = '<0.001' - fiatFee = round(fiatFee, -3) + else fiatFee = round(fiatFee, -3) const feeString = `${displayFee} ${feeDenom.name} (${fiatFee} ${defaultFiat})` let bodyText = lstrings.activate_wallet_token_scene_body