Updated on 2026-08-14
This commit is contained in:
commit
396e2cf3e1
3 changed files with 12 additions and 20 deletions
|
|
@ -57,7 +57,7 @@
|
|||
},
|
||||
{
|
||||
"name": "NEW_ONRAMP_MAIN_ENABLED",
|
||||
"version": "undefined"
|
||||
"version": "5.29.0"
|
||||
},
|
||||
{
|
||||
"name": "ACCOUNTS_FEATURE_ENABLED",
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@ import com.tangem.domain.models.currency.CryptoCurrency
|
|||
import com.tangem.domain.models.currency.CryptoCurrencyStatus
|
||||
import com.tangem.domain.models.staking.*
|
||||
import com.tangem.domain.models.staking.action.StakingActionType
|
||||
import com.tangem.domain.models.wallet.UserWallet
|
||||
import com.tangem.domain.models.wallet.UserWalletId
|
||||
import com.tangem.domain.staking.*
|
||||
import com.tangem.domain.staking.analytics.StakeScreenSource
|
||||
|
|
@ -153,7 +152,11 @@ internal class StakingModel @Inject constructor(
|
|||
private var feeCryptoCurrencyStatus: CryptoCurrencyStatus? = null
|
||||
private var minimumTransactionAmount: EnterAmountBoundary? = null
|
||||
|
||||
private var userWallet: UserWallet by Delegates.notNull()
|
||||
private val userWallet by lazy {
|
||||
requireNotNull(
|
||||
getUserWalletUseCase(userWalletId).getOrNull(),
|
||||
) { "No wallet found for id: $userWalletId" }
|
||||
}
|
||||
private var appCurrency: AppCurrency by Delegates.notNull()
|
||||
|
||||
private val balancesToShow: List<BalanceItem>
|
||||
|
|
@ -925,17 +928,6 @@ internal class StakingModel @Inject constructor(
|
|||
}
|
||||
|
||||
private fun subscribeOnCurrencyStatusUpdates() {
|
||||
getUserWalletUseCase(userWalletId).fold(
|
||||
ifRight = { wallet ->
|
||||
userWallet = wallet
|
||||
},
|
||||
ifLeft = {
|
||||
stakingEventFactory.createGenericErrorAlert(it.toString())
|
||||
stateController.update(
|
||||
SetConfirmationStateResetAssentTransformer(cryptoCurrencyStatus = cryptoCurrencyStatus),
|
||||
)
|
||||
},
|
||||
)
|
||||
getSingleCryptoCurrencyStatusUseCase.invokeMultiWallet(
|
||||
userWalletId = userWalletId,
|
||||
currencyId = cryptoCurrencyId,
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@ import com.tangem.domain.feedback.models.FeedbackEmailType
|
|||
import com.tangem.domain.models.currency.CryptoCurrency
|
||||
import com.tangem.domain.models.currency.CryptoCurrencyStatus
|
||||
import com.tangem.domain.models.network.Network
|
||||
import com.tangem.domain.models.wallet.UserWallet
|
||||
import com.tangem.domain.models.wallet.UserWalletId
|
||||
import com.tangem.domain.promo.GetStoryContentUseCase
|
||||
import com.tangem.domain.promo.ShouldShowStoriesUseCase
|
||||
|
|
@ -77,7 +76,6 @@ import java.text.DecimalFormat
|
|||
import java.text.NumberFormat
|
||||
import java.util.Locale
|
||||
import javax.inject.Inject
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
typealias SuccessLoadedSwapData = Map<SwapProvider, SwapState.QuotesLoadedState>
|
||||
|
||||
|
|
@ -115,11 +113,15 @@ internal class SwapModel @Inject constructor(
|
|||
private val userWalletId = params.userWalletId
|
||||
private val isInitiallyReversed = params.isInitialReverseOrder
|
||||
|
||||
private val userWallet by lazy {
|
||||
requireNotNull(
|
||||
getUserWalletUseCase(userWalletId).getOrNull(),
|
||||
) { "No wallet found for id: $userWalletId" }
|
||||
}
|
||||
private val swapInteractor = swapInteractorFactory.create(userWalletId)
|
||||
|
||||
private lateinit var initialFromStatus: CryptoCurrencyStatus
|
||||
private var initialToStatus: CryptoCurrencyStatus? = null
|
||||
private var userWallet: UserWallet by Delegates.notNull()
|
||||
|
||||
private var isBalanceHidden = true
|
||||
|
||||
|
|
@ -186,12 +188,10 @@ internal class SwapModel @Inject constructor(
|
|||
val toStatus = initialCurrencyTo?.let {
|
||||
getSingleCryptoCurrencyStatusUseCase.invokeMultiWalletSync(userWalletId, it.id).getOrNull()
|
||||
}
|
||||
val wallet = getUserWalletUseCase(userWalletId).getOrNull()
|
||||
|
||||
if (fromStatus == null || wallet == null) {
|
||||
if (fromStatus == null) {
|
||||
uiState = stateBuilder.addAlert(uiState = uiState, onDismiss = swapRouter::back)
|
||||
} else {
|
||||
userWallet = wallet
|
||||
initialFromStatus = fromStatus
|
||||
initialToStatus = toStatus
|
||||
initTokens(isInitiallyReversed)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue