From 56faa035619c276d9f73c7b87365b4e7e6f9491b Mon Sep 17 00:00:00 2001 From: Tangem Date: Wed, 31 Mar 2021 12:57:45 +0300 Subject: [PATCH] Updated on 2026-08-14 --- .../redux/middlewares/WalletMiddleware.kt | 8 +++++ .../redux/reducers/OnWalletLoadedReducer.kt | 2 +- .../main/res/layout/item_currency_wallet.xml | 32 +++++++++++-------- .../main/res/layout/layout_wallet_details.xml | 13 ++++++-- 4 files changed, 39 insertions(+), 16 deletions(-) diff --git a/app/src/main/java/com/tangem/tap/features/wallet/redux/middlewares/WalletMiddleware.kt b/app/src/main/java/com/tangem/tap/features/wallet/redux/middlewares/WalletMiddleware.kt index af6ceb3d2d..6cd4f9da3a 100644 --- a/app/src/main/java/com/tangem/tap/features/wallet/redux/middlewares/WalletMiddleware.kt +++ b/app/src/main/java/com/tangem/tap/features/wallet/redux/middlewares/WalletMiddleware.kt @@ -6,6 +6,7 @@ import androidx.core.content.ContextCompat import com.tangem.TangemSdkError import com.tangem.blockchain.common.* import com.tangem.common.CompletionResult +import com.tangem.common.extensions.isZero import com.tangem.tap.* import com.tangem.tap.common.analytics.FirebaseAnalyticsHandler import com.tangem.tap.common.extensions.copyToClipboard @@ -59,6 +60,13 @@ class WalletMiddleware { } } is WalletAction.LoadWallet.Success -> { + val coinAmount = action.wallet.amounts[AmountType.Coin]?.value + if (coinAmount != null && !coinAmount.isZero()) { + if (walletState?.getWalletData(action.wallet.blockchain.currency) == null) { + store.dispatch(WalletAction.MultiWallet.AddBlockchain(action.wallet.blockchain)) + store.dispatch(WalletAction.LoadWallet.Success(action.wallet)) + } + } store.dispatch(WalletAction.Warnings.CheckHashesCount.CheckHashesCountOnline) warningsMiddleware.tryToShowAppRatingWarning(action.wallet) } diff --git a/app/src/main/java/com/tangem/tap/features/wallet/redux/reducers/OnWalletLoadedReducer.kt b/app/src/main/java/com/tangem/tap/features/wallet/redux/reducers/OnWalletLoadedReducer.kt index 59edbdd896..6941106a0c 100644 --- a/app/src/main/java/com/tangem/tap/features/wallet/redux/reducers/OnWalletLoadedReducer.kt +++ b/app/src/main/java/com/tangem/tap/features/wallet/redux/reducers/OnWalletLoadedReducer.kt @@ -27,7 +27,7 @@ class OnWalletLoadedReducer { } else { val fiatCurrencySymbol = store.state.globalState.appCurrency val amount = wallet.amounts[AmountType.Coin]?.value - if (walletState.getWalletData(wallet.blockchain.currency) == null && amount?.isZero() != false) { + if (walletState.getWalletData(wallet.blockchain.currency) == null) { return walletState } if (wallet.blockchain != Blockchain.Ethereum) { diff --git a/app/src/main/res/layout/item_currency_wallet.xml b/app/src/main/res/layout/item_currency_wallet.xml index be3b049566..576619305c 100644 --- a/app/src/main/res/layout/item_currency_wallet.xml +++ b/app/src/main/res/layout/item_currency_wallet.xml @@ -17,7 +17,7 @@ + android:layout_height="76dp"> diff --git a/app/src/main/res/layout/layout_wallet_details.xml b/app/src/main/res/layout/layout_wallet_details.xml index d276934193..f8ac54763e 100644 --- a/app/src/main/res/layout/layout_wallet_details.xml +++ b/app/src/main/res/layout/layout_wallet_details.xml @@ -83,7 +83,7 @@ app:layout_constraintEnd_toEndOf="@id/guideline" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/chip_group_address_type" - app:layout_constraintBottom_toBottomOf="@id/btn_copy" + app:layout_constraintBottom_toBottomOf="@id/v_qr_lower_end" tools:src="@drawable/ic_qr_code_show" /> + +