Updated on 2026-08-14

This commit is contained in:
Tangem 2023-08-31 16:58:05 +03:00
parent dc4e8c740b
commit fefe37a890
23 changed files with 285 additions and 140 deletions

View file

@ -201,7 +201,6 @@ internal class WalletViewModel @Inject constructor(
private fun updateSingleCurrencyContent(index: Int, isRefreshing: Boolean) {
val wallet = getWallet(index)
val blockchain = getCardTypeResolver(index).getBlockchain()
updateButtons(userWalletId = wallet.walletId, currencyId = blockchain.id)
updateTxHistory(
blockchain = blockchain,
derivationStyle = wallet.scanResponse.derivationStyleProvider.getDerivationStyle(),
@ -244,15 +243,18 @@ internal class WalletViewModel @Inject constructor(
isRefreshing = isRefreshing,
)
either.onRight { status -> cryptoCurrencyStatus = status }
either.onRight { status ->
cryptoCurrencyStatus = status
updateButtons(userWalletId = userWalletId, currency = status.currency)
}
}
.flowOn(dispatchers.io)
.launchIn(viewModelScope)
.saveIn(marketPriceJobHolder)
}
private fun updateButtons(userWalletId: UserWalletId, currencyId: String) {
getCryptoCurrencyActionsUseCase(userWalletId = userWalletId, tokenId = currencyId)
private fun updateButtons(userWalletId: UserWalletId, currency: CryptoCurrency) {
getCryptoCurrencyActionsUseCase(userWalletId = userWalletId, cryptoCurrency = currency)
.distinctUntilChanged()
.onEach { uiState = stateFactory.getSingleCurrencyManageButtonsState(actions = it.states) }
.flowOn(dispatchers.io)