Updated on 2026-08-14

This commit is contained in:
Tangem 2022-12-28 12:37:32 +03:00
parent 80bfc4444a
commit f7b0479994
2 changed files with 3 additions and 2 deletions

View file

@ -39,6 +39,7 @@ class DetailsViewModel(private val store: Store<AppState>) {
SettingsElement.AppSettings -> if (state.isBiometricsAvailable) it else null
SettingsElement.AppCurrency -> if (state.scanResponse?.card?.isMultiwalletAllowed != true) it else null
SettingsElement.TermsOfUse -> if (state.scanResponse?.card?.isStart2Coin == true) it else null
SettingsElement.ReferralProgram -> if (state.scanResponse?.card?.isMultiwalletAllowed == true) it else null
else -> it
}
}

View file

@ -107,9 +107,9 @@ internal class ReferralViewModel @Inject constructor(
private fun ReferralData.getDiscountValue(): String {
val discountSymbol = when (discountType) {
DiscountType.PERCENTAGE -> "%"
DiscountType.VALUE -> error("Value doesn't support")
DiscountType.VALUE -> this.getToken().symbol
}
return "$discount $discountSymbol"
return "$discount$discountSymbol"
}
private fun ReferralData.getToken() = requireNotNull(tokens.firstOrNull()) { "Token list is empty" }