Updated on 2026-08-14
This commit is contained in:
parent
319fd373b5
commit
80c1b5ba20
1 changed files with 14 additions and 8 deletions
|
|
@ -510,14 +510,7 @@ internal class SwapModel @Inject constructor(
|
|||
dataState.fromCryptoCurrency
|
||||
}
|
||||
|
||||
fromCryptoCurrency?.let { cryptoCurrency ->
|
||||
dataState = dataState.copy(
|
||||
feePaidCryptoCurrency = getFeePaidCryptoCurrencyStatusSyncUseCase(
|
||||
userWalletId = userWalletId,
|
||||
cryptoCurrencyStatus = cryptoCurrency,
|
||||
).getOrNull(),
|
||||
)
|
||||
}
|
||||
if (fromCryptoCurrency != null) updateFeePaidCryptoCurrencyFor(fromCryptoCurrency)
|
||||
|
||||
subscribeToCoinBalanceUpdatesIfNeeded()
|
||||
}.onFailure { error ->
|
||||
|
|
@ -754,6 +747,15 @@ internal class SwapModel @Inject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
private suspend fun updateFeePaidCryptoCurrencyFor(fromToken: CryptoCurrencyStatus) {
|
||||
dataState = dataState.copy(
|
||||
feePaidCryptoCurrency = getFeePaidCryptoCurrencyStatusSyncUseCase(
|
||||
userWalletId = userWalletId,
|
||||
cryptoCurrencyStatus = fromToken,
|
||||
).getOrNull(),
|
||||
)
|
||||
}
|
||||
|
||||
private fun loadQuotesTask(
|
||||
fromToken: CryptoCurrencyStatus,
|
||||
fromAccount: Account.CryptoPortfolio?,
|
||||
|
|
@ -1402,6 +1404,9 @@ internal class SwapModel @Inject constructor(
|
|||
toAccount = toAccount,
|
||||
selectedProvider = null,
|
||||
)
|
||||
modelScope.launch {
|
||||
updateFeePaidCryptoCurrencyFor(fromToken)
|
||||
}
|
||||
startLoadingQuotes(
|
||||
fromToken = fromToken,
|
||||
fromAccount = fromAccount,
|
||||
|
|
@ -1544,6 +1549,7 @@ internal class SwapModel @Inject constructor(
|
|||
toAccount = newToAccount,
|
||||
)
|
||||
isOrderReversed = !isOrderReversed
|
||||
updateFeePaidCryptoCurrencyFor(newFromToken)
|
||||
dataState.tokensDataState?.let { tokensDataState ->
|
||||
updateTokensState(tokensDataState)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue