Updated on 2026-08-14
This commit is contained in:
parent
f6f96ed8b5
commit
a7f2a97617
1 changed files with 8 additions and 5 deletions
|
|
@ -109,11 +109,14 @@ internal class SwapViewModel @Inject constructor(
|
|||
init {
|
||||
viewModelScope.launch(dispatchers.io) {
|
||||
swapInteractor.getSelectedWallet()?.let {
|
||||
initialCryptoCurrencyStatus =
|
||||
requireNotNull(getCryptoCurrencyStatusUseCase(it.walletId, initialCryptoCurrency.id).getOrNull()) {
|
||||
"Failed to get initial crypto currency status"
|
||||
}
|
||||
initTokens()
|
||||
val cryptoCurrencyStatus =
|
||||
getCryptoCurrencyStatusUseCase(it.walletId, initialCryptoCurrency.id).getOrNull()
|
||||
if (cryptoCurrencyStatus == null) {
|
||||
uiState = stateBuilder.addAlert(uiState, swapRouter::back)
|
||||
} else {
|
||||
initialCryptoCurrencyStatus = cryptoCurrencyStatus
|
||||
initTokens()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue