Updated on 2026-08-14
This commit is contained in:
parent
993c28ecfd
commit
0b7e1f6bb5
9 changed files with 54 additions and 6 deletions
|
|
@ -116,7 +116,7 @@ sealed interface SwapWarning {
|
|||
* @property priceImpact in format = 10 (means 10%)
|
||||
*/
|
||||
data class HighPriceImpact(val priceImpact: Int, val notificationConfig: NotificationConfig) : SwapWarning
|
||||
data class TooSmallAmountWarning(val notificationConfig: NotificationConfig) : SwapWarning
|
||||
data class GeneralError(val notificationConfig: NotificationConfig) : SwapWarning
|
||||
data class UnableToCoverFeeWarning(val notificationConfig: NotificationConfig) : SwapWarning
|
||||
data class GeneralWarning(val notificationConfig: NotificationConfig) : SwapWarning
|
||||
data class GeneralInformational(val notificationConfig: NotificationConfig) : SwapWarning
|
||||
|
|
|
|||
|
|
@ -384,6 +384,23 @@ internal class StateBuilder(
|
|||
),
|
||||
)
|
||||
}
|
||||
is Warning.MinAmountWarning -> {
|
||||
warnings.add(
|
||||
SwapWarning.GeneralError(
|
||||
NotificationConfig(
|
||||
title = resourceReference(R.string.send_notification_invalid_amount_title),
|
||||
subtitle = resourceReference(
|
||||
R.string.send_notification_invalid_minimum_amount_text,
|
||||
wrappedList(
|
||||
it.dustValue.toPlainString(),
|
||||
it.dustValue.toPlainString(),
|
||||
),
|
||||
),
|
||||
iconResId = R.drawable.ic_alert_circle_24,
|
||||
),
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -523,7 +540,7 @@ internal class StateBuilder(
|
|||
|
||||
private fun getWarningForError(dataError: DataError, fromToken: CryptoCurrency): SwapWarning {
|
||||
return when (dataError) {
|
||||
is DataError.ExchangeTooSmallAmountError -> SwapWarning.TooSmallAmountWarning(
|
||||
is DataError.ExchangeTooSmallAmountError -> SwapWarning.GeneralError(
|
||||
notificationConfig = NotificationConfig(
|
||||
title = resourceReference(
|
||||
id = R.string.warning_express_too_minimal_amount_title,
|
||||
|
|
|
|||
|
|
@ -356,7 +356,7 @@ private fun SwapWarnings(warnings: List<SwapWarning>) {
|
|||
config = warning.notificationConfig,
|
||||
)
|
||||
}
|
||||
is SwapWarning.TooSmallAmountWarning -> {
|
||||
is SwapWarning.GeneralError -> {
|
||||
Notification(
|
||||
config = warning.notificationConfig,
|
||||
iconTint = TangemTheme.colors.icon.warning,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue