Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ internal class WithdrawalViewModel @Inject constructor(
val feeInEntryCurrency: Fiat?
get() {
val fee = feeAmount ?: return null
val rate = entryRate ?: return fee
val rate = entryRate ?: return null
return fee.convertingTo(rate)
}

Expand All @@ -120,7 +120,7 @@ internal class WithdrawalViewModel @Inject constructor(
val netTransferAmount: Fiat
get() {
val amount = amountEntryState.selectedAmount.localFiat.nativeAmount
val fee = feeInEntryCurrency ?: 0.toFiat(amount.currencyCode)
val fee = feeInEntryCurrency ?: 0.00.toFiat(amount.currencyCode)
return amount - fee
}

Expand All @@ -138,7 +138,7 @@ internal class WithdrawalViewModel @Inject constructor(
return EnteredAmountError.InsufficientFunds
}

val fee = feeInEntryCurrency ?: 0.toFiat(tokenBalance.currencyCode)
val fee = feeInEntryCurrency ?: 0.00.toFiat(tokenBalance.currencyCode)

if (enteredAmount.valueLessThanOrEqualTo(fee)) {
return EnteredAmountError.TooLow
Expand Down Expand Up @@ -229,6 +229,7 @@ internal class WithdrawalViewModel @Inject constructor(

init {
numberInputHelper.reset()
dispatchEvent(Event.OnEntryRateUpdated(exchange.entryRate))

stateFlow
.mapNotNull { it.selectedTokenAddress }
Expand Down Expand Up @@ -605,7 +606,7 @@ internal class WithdrawalViewModel @Inject constructor(
usdf = it,
rate = amount.localFiat.rate
)
} ?: LocalFiat.fromUsd(0.toFiat(), rate = amount.localFiat.rate)
} ?: LocalFiat.fromUsd(0.00.toFiat(), rate = amount.localFiat.rate)

transactionController.withdrawUsdf(
amount = amount,
Expand Down
Loading