From bbd8ca801b520353dbaa408389f6513dc7753724 Mon Sep 17 00:00:00 2001 From: Tangem Date: Thu, 8 Apr 2021 14:33:59 +0300 Subject: [PATCH] Updated on 2026-08-14 --- .../tap/features/wallet/ui/MultipleAddressUiHelper.kt | 8 -------- .../tap/features/wallet/ui/WalletDetailsFragment.kt | 4 ++-- .../tap/features/wallet/ui/wallet/SingleWalletView.kt | 4 ++-- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/com/tangem/tap/features/wallet/ui/MultipleAddressUiHelper.kt b/app/src/main/java/com/tangem/tap/features/wallet/ui/MultipleAddressUiHelper.kt index f7b06a5b5e..66425c74a7 100644 --- a/app/src/main/java/com/tangem/tap/features/wallet/ui/MultipleAddressUiHelper.kt +++ b/app/src/main/java/com/tangem/tap/features/wallet/ui/MultipleAddressUiHelper.kt @@ -5,7 +5,6 @@ import com.tangem.blockchain.blockchains.bitcoin.BitcoinAddressType import com.tangem.blockchain.blockchains.cardano.CardanoAddressType import com.tangem.blockchain.common.Blockchain import com.tangem.blockchain.common.address.AddressType -import com.tangem.tap.common.redux.global.CryptoCurrencyName import com.tangem.wallet.R class MultipleAddressUiHelper { @@ -20,13 +19,6 @@ class MultipleAddressUiHelper { } } - fun idToType(id: Int, currencyName: CryptoCurrencyName?): AddressType? { - val blockchain = currencyName?.let { currency -> - Blockchain.fromCurrency(currency) - } - return idToType(id, blockchain) - } - fun idToType(id: Int, blockchain: Blockchain?): AddressType? { return when (id) { R.id.chip_default -> { diff --git a/app/src/main/java/com/tangem/tap/features/wallet/ui/WalletDetailsFragment.kt b/app/src/main/java/com/tangem/tap/features/wallet/ui/WalletDetailsFragment.kt index 8913acc643..94106ba2f9 100644 --- a/app/src/main/java/com/tangem/tap/features/wallet/ui/WalletDetailsFragment.kt +++ b/app/src/main/java/com/tangem/tap/features/wallet/ui/WalletDetailsFragment.kt @@ -157,7 +157,7 @@ class WalletDetailsFragment : Fragment(R.layout.fragment_wallet_details), StoreS private fun setupAddressCard(state: WalletData) { if (state.walletAddresses != null) { - if (state.shouldShowMultipleAddress()) { + if (state.shouldShowMultipleAddress() && state.blockchain != null) { (card_balance as? ViewGroup)?.beginDelayedTransition() chip_group_address_type.show() chip_group_address_type.fitChipsByGroupWidth() @@ -167,7 +167,7 @@ class WalletDetailsFragment : Fragment(R.layout.fragment_wallet_details), StoreS chip_group_address_type.setOnCheckedChangeListener { group, checkedId -> if (checkedId == -1) return@setOnCheckedChangeListener - val type = MultipleAddressUiHelper.idToType(checkedId, state.currencyData.currencySymbol) + val type = MultipleAddressUiHelper.idToType(checkedId, state.blockchain) type?.let { store.dispatch(WalletAction.ChangeSelectedAddress(type)) } } } else { diff --git a/app/src/main/java/com/tangem/tap/features/wallet/ui/wallet/SingleWalletView.kt b/app/src/main/java/com/tangem/tap/features/wallet/ui/wallet/SingleWalletView.kt index e7ff1e5db0..d6762f815b 100644 --- a/app/src/main/java/com/tangem/tap/features/wallet/ui/wallet/SingleWalletView.kt +++ b/app/src/main/java/com/tangem/tap/features/wallet/ui/wallet/SingleWalletView.kt @@ -187,7 +187,7 @@ class SingleWalletView : WalletView { private fun setupAddressCard(state: WalletData) { val fragment = fragment ?: return - if (state.walletAddresses != null) { + if (state.walletAddresses != null && state.blockchain != null) { fragment.l_address?.show() if (state.shouldShowMultipleAddress()) { (fragment.l_address as? ViewGroup)?.beginDelayedTransition() @@ -199,7 +199,7 @@ class SingleWalletView : WalletView { fragment.chip_group_address_type.setOnCheckedChangeListener { group, checkedId -> if (checkedId == -1) return@setOnCheckedChangeListener - val type = MultipleAddressUiHelper.idToType(checkedId, state.currencyData.currencySymbol) + val type = MultipleAddressUiHelper.idToType(checkedId, state.blockchain) type?.let { store.dispatch(WalletAction.ChangeSelectedAddress(type)) } } } else {