Updated on 2026-08-14
This commit is contained in:
parent
3aaac04037
commit
5aadb8e2a8
1 changed files with 20 additions and 11 deletions
|
|
@ -142,8 +142,13 @@ internal class YieldSupplyStartEarningModel @Inject constructor(
|
|||
it.copy(yieldSupplyFeeUM = YieldSupplyFeeUM.Loading)
|
||||
}
|
||||
|
||||
val maxFee = yieldSupplyGetMaxFeeUseCase(userWalletId, cryptoCurrencyStatus).getOrNull() ?: return
|
||||
val estimatedFee = yieldSupplyGetCurrentFeeUseCase(userWalletId, cryptoCurrencyStatus).getOrNull() ?: return
|
||||
val maxFee = yieldSupplyGetMaxFeeUseCase(userWalletId, cryptoCurrencyStatus).getOrNull()
|
||||
val estimatedFee = yieldSupplyGetCurrentFeeUseCase(userWalletId, cryptoCurrencyStatus).getOrNull()
|
||||
|
||||
if (estimatedFee == null || maxFee == null) {
|
||||
showFeeUnknownError()
|
||||
return
|
||||
}
|
||||
|
||||
val transactionListData = yieldSupplyStartEarningUseCase(
|
||||
userWalletId = userWalletId,
|
||||
|
|
@ -152,15 +157,7 @@ internal class YieldSupplyStartEarningModel @Inject constructor(
|
|||
).getOrNull()
|
||||
|
||||
if (transactionListData == null) {
|
||||
uiState.update {
|
||||
it.copy(yieldSupplyFeeUM = YieldSupplyFeeUM.Error)
|
||||
}
|
||||
yieldSupplyNotificationsUpdateTrigger.triggerUpdate(
|
||||
data = YieldSupplyNotificationData(
|
||||
feeValue = null,
|
||||
feeError = GetFeeError.UnknownError,
|
||||
),
|
||||
)
|
||||
showFeeUnknownError()
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -372,4 +369,16 @@ internal class YieldSupplyStartEarningModel @Inject constructor(
|
|||
popBack = params.callback::onBackClick,
|
||||
)
|
||||
}
|
||||
|
||||
private suspend fun showFeeUnknownError() {
|
||||
uiState.update {
|
||||
it.copy(yieldSupplyFeeUM = YieldSupplyFeeUM.Error)
|
||||
}
|
||||
yieldSupplyNotificationsUpdateTrigger.triggerUpdate(
|
||||
data = YieldSupplyNotificationData(
|
||||
feeValue = null,
|
||||
feeError = GetFeeError.UnknownError,
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue