From 5b2fb1b22c496d7d0c74c8575332b3907281a5b8 Mon Sep 17 00:00:00 2001 From: Tangem Date: Mon, 4 Aug 2025 14:50:59 +0500 Subject: [PATCH] Updated on 2026-08-14 --- .../transformers/WcConnectButtonAvailabilityConverter.kt | 8 +++++--- .../model/transformers/WcNetworksInfoConverter.kt | 6 +++++- .../transaction/model/WcSendTransactionModel.kt | 5 +++++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/transformers/WcConnectButtonAvailabilityConverter.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/transformers/WcConnectButtonAvailabilityConverter.kt index 3e25e03e74..72042b2e79 100644 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/transformers/WcConnectButtonAvailabilityConverter.kt +++ b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/transformers/WcConnectButtonAvailabilityConverter.kt @@ -7,10 +7,12 @@ import com.tangem.utils.converter.Converter internal object WcConnectButtonAvailabilityConverter : Converter { override fun convert(value: Input): Boolean { - val (missingNetworks, requiredNetworks, availableNetworks, selectedNetworks) = value + val missing = value.missingNetworks + val required = value.requiredNetworks + val available = value.availableNetworks + val selected = value.selectedNetworks - return missingNetworks.isEmpty() && - (requiredNetworks.isNotEmpty() || availableNetworks.isNotEmpty() || selectedNetworks.isNotEmpty()) + return missing.isEmpty() && (required.isNotEmpty() || available.isNotEmpty() || selected.isNotEmpty()) } data class Input( diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/transformers/WcNetworksInfoConverter.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/transformers/WcNetworksInfoConverter.kt index 96da1ebf09..4d690bc279 100644 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/transformers/WcNetworksInfoConverter.kt +++ b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/transformers/WcNetworksInfoConverter.kt @@ -10,7 +10,11 @@ import kotlinx.collections.immutable.toImmutableList @Suppress("DestructuringDeclarationWithTooManyEntries") internal object WcNetworksInfoConverter : Converter { override fun convert(value: Input): WcNetworksInfo { - val (missing, required, available, notAdded, additionallyEnabled) = value + val missing = value.missingNetworks + val required = value.requiredNetworks + val available = value.availableNetworks + val notAdded = value.notAddedNetworks + val additionallyEnabled = value.additionallyEnabledNetworks return when { missing.isNotEmpty() -> WcNetworksInfo.MissingRequiredNetworkInfo(missing.joinToString { it.name }) required.isEmpty() && available.isEmpty() && notAdded.isNotEmpty() -> WcNetworksInfo.NoneNetworksAdded diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/model/WcSendTransactionModel.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/model/WcSendTransactionModel.kt index 1494a6161a..623125db6f 100644 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/model/WcSendTransactionModel.kt +++ b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/model/WcSendTransactionModel.kt @@ -90,6 +90,7 @@ internal class WcSendTransactionModel @Inject constructor( private var wcApproval: WcApproval? = null private var sign: () -> Unit = {} private val feeReloadState = MutableStateFlow(false) + private val signatureReceivedAnalyticsSendState = MutableStateFlow(false) init { @Suppress("UnusedPrivateMember") @@ -373,6 +374,8 @@ internal class WcSendTransactionModel @Inject constructor( useCase: WcSignUseCase<*>, securityCheck: Lce, ) { + if (signatureReceivedAnalyticsSendState.value) return + val emulationStatus = when (securityCheck) { is Lce.Content -> when (securityCheck.content.result.simulation) { SimulationResult.FailedToSimulate -> EmulationStatus.CanNotEmulate @@ -389,5 +392,7 @@ internal class WcSendTransactionModel @Inject constructor( emulationStatus = emulationStatus, ), ) + + signatureReceivedAnalyticsSendState.value = true } } \ No newline at end of file