Updated on 2026-08-14

This commit is contained in:
Tangem 2025-12-04 10:20:17 +04:00
parent 3aaac04037
commit 5aadb8e2a8

View file

@ -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,
),
)
}
}