From 8fef5574249de3b49f2cdf08c8c2d60f9b05a8c4 Mon Sep 17 00:00:00 2001 From: Tangem Date: Wed, 9 Apr 2025 11:08:51 +0500 Subject: [PATCH] Updated on 2026-08-14 --- .../v2/subcomponents/amount/SendAmountComponentParams.kt | 5 +++-- .../send/v2/subcomponents/amount/model/SendAmountModel.kt | 5 +---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/amount/SendAmountComponentParams.kt b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/amount/SendAmountComponentParams.kt index 7185402604..0df4012c9d 100644 --- a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/amount/SendAmountComponentParams.kt +++ b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/amount/SendAmountComponentParams.kt @@ -16,6 +16,7 @@ internal sealed class SendAmountComponentParams { abstract val userWallet: UserWallet abstract val appCurrency: AppCurrency abstract val cryptoCurrencyStatus: CryptoCurrencyStatus + abstract val predefinedAmountValue: String? data class AmountParams( override val state: AmountState, @@ -23,10 +24,10 @@ internal sealed class SendAmountComponentParams { override val userWallet: UserWallet, override val appCurrency: AppCurrency, override val cryptoCurrencyStatus: CryptoCurrencyStatus, + override val predefinedAmountValue: String?, val isEditMode: Boolean, val callback: ModelCallback, val currentRoute: Flow, - val predefinedAmountValue: String?, val isBalanceHidingFlow: StateFlow, ) : SendAmountComponentParams() @@ -36,8 +37,8 @@ internal sealed class SendAmountComponentParams { override val userWallet: UserWallet, override val appCurrency: AppCurrency, override val cryptoCurrencyStatus: CryptoCurrencyStatus, + override val predefinedAmountValue: String?, val blockClickEnableFlow: StateFlow, - val predefinedAmountValue: String?, val isPredefinedValues: Boolean, ) : SendAmountComponentParams() } \ No newline at end of file diff --git a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/amount/model/SendAmountModel.kt b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/amount/model/SendAmountModel.kt index 5f37e5f84f..40b5688362 100644 --- a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/amount/model/SendAmountModel.kt +++ b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/amount/model/SendAmountModel.kt @@ -98,10 +98,7 @@ internal class SendAmountModel @Inject constructor( ), ) } - val params = params as? SendAmountComponentParams.AmountBlockParams - if (params?.predefinedAmountValue != null) { - onAmountValueChange(params.predefinedAmountValue) - } + params.predefinedAmountValue?.let(::onAmountValueChange) } }