Updated on 2026-08-14

This commit is contained in:
Tangem 2022-08-18 11:54:10 +04:00
parent 2ff50a4489
commit ec5e270985

View file

@ -114,22 +114,26 @@ class WalletFragment : Fragment(R.layout.fragment_wallet), StoreSubscriber<Walle
override fun newState(state: WalletState) {
if (activity == null || view == null) return
val isSaltPay = store.state.globalState.scanResponse?.card?.isSaltPay == true
when {
isSaltPay -> {
isSaltPay && (walletView !is SaltPaySingleWalletView) -> {
walletView = SaltPaySingleWalletView()
walletView.changeWalletView(this, binding)
}
state.isMultiwalletAllowed &&
state.primaryWallet?.currencyData?.status != BalanceStatus.EmptyCard &&
walletView is SingleWalletView -> {
state.isMultiwalletAllowed && state.primaryWallet?.currencyData?.status != BalanceStatus.EmptyCard &&
walletView !is MultiWalletView -> {
walletView = MultiWalletView()
walletView.changeWalletView(this, binding)
}
!state.isMultiwalletAllowed && walletView is MultiWalletView -> {
!state.isMultiwalletAllowed && walletView !is SingleWalletView -> {
walletView = SingleWalletView()
walletView.changeWalletView(this, binding)
}
else -> {} // we keep the same view unless we scan a card that requires a different view
}
walletView.changeWalletView(this, binding)
walletView.onNewState(state)
if (!state.shouldShowDetails) {