Updated on 2026-08-14

This commit is contained in:
Tangem 2024-12-06 16:31:11 +04:00
parent dcb6e2b6d2
commit 476bb30175
3 changed files with 9 additions and 6 deletions

View file

@ -17,7 +17,7 @@
},
{
"name": "ONRAMP_ENABLED",
"version": "undefined"
"version": "5.19.0"
},
{
"name": "MAIN_ACTION_BUTTONS_ENABLED",

View file

@ -1,5 +1,6 @@
package com.tangem.feature.wallet.presentation.wallet.state.transformers
import com.tangem.domain.common.util.cardTypesResolver
import com.tangem.domain.wallets.models.UserWallet
import com.tangem.feature.wallet.presentation.wallet.domain.WalletAdditionalInfoFactory
import com.tangem.feature.wallet.presentation.wallet.domain.WalletImageResolver
@ -58,7 +59,7 @@ internal class InitializeWalletsTransformer(
multiCurrencyCreator = {
WalletState.MultiCurrency.Locked(
walletCardState = userWallet.toLockedWalletCardState(),
buttons = createMultiWalletEnabledButtons(),
buttons = createMultiWalletEnabledButtons(userWallet),
bottomSheetConfig = null,
onUnlockNotificationClick = clickIntents::onOpenUnlockWalletsBottomSheetClick,
)
@ -75,7 +76,7 @@ internal class InitializeWalletsTransformer(
visaWalletCreator = {
WalletState.Visa.Locked(
walletCardState = userWallet.toLockedWalletCardState(),
buttons = createMultiWalletEnabledButtons(),
buttons = createMultiWalletEnabledButtons(userWallet),
bottomSheetConfig = null,
onUnlockNotificationClick = clickIntents::onOpenUnlockWalletsBottomSheetClick,
onExploreClick = clickIntents::onExploreClick,
@ -95,8 +96,9 @@ internal class InitializeWalletsTransformer(
)
}
private fun createMultiWalletEnabledButtons(): PersistentList<WalletManageButton> {
if (!walletFeatureToggles.isMainActionButtonsEnabled) return persistentListOf()
private fun createMultiWalletEnabledButtons(userWallet: UserWallet): PersistentList<WalletManageButton> {
val isSingleWalletWithToken = userWallet.scanResponse.cardTypesResolver.isSingleWalletWithToken()
if (!walletFeatureToggles.isMainActionButtonsEnabled || isSingleWalletWithToken) return persistentListOf()
return persistentListOf(
WalletManageButton.Buy(enabled = false, dimContent = false, onClick = {}),

View file

@ -94,7 +94,8 @@ internal class WalletLoadingStateFactory(
}
private fun createMultiWalletActions(userWallet: UserWallet): PersistentList<WalletManageButton> {
if (!walletFeatureToggles.isMainActionButtonsEnabled) return persistentListOf()
val isSingleWalletWithToken = userWallet.scanResponse.cardTypesResolver.isSingleWalletWithToken()
if (!walletFeatureToggles.isMainActionButtonsEnabled || isSingleWalletWithToken) return persistentListOf()
return persistentListOf(
WalletManageButton.Buy(