Skip to content

Commit 260bfbf

Browse files
committed
chore(tokens): correct balance comparison for tokenList filtering
Signed-off-by: Brandon McAnsh <[email protected]>
1 parent 2a102ba commit 260bfbf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

apps/flipcash/shared/tokens/src/main/kotlin/SelectTokenViewModel.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,14 @@ class SelectTokenViewModel @Inject constructor(
6969
)
7070
}.sortedByDescending { it.balance.nativeAmount }
7171
.filter {
72+
val baselineAmount = 0.01.toFiat(rate.currency)
7273
when (purpose) {
7374
// show all tokens we have accounts for as deposit targets
7475
TokenPurpose.Deposit -> true
7576
// show all tokens with non-zero balance
7677
else -> {
77-
it.balance.nativeAmount.quarks > 0.01.toFiat(rate.currency).quarks
78+
it.balance.nativeAmount.valueNonZero() &&
79+
it.balance.nativeAmount.valueGreaterThanOrEqualTo(baselineAmount)
7880
}
7981
}
8082
}

0 commit comments

Comments
 (0)