diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/WcConnectedAppInfoModel.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/WcConnectedAppInfoModel.kt index 622f3c98f0..d49fa80461 100644 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/WcConnectedAppInfoModel.kt +++ b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/WcConnectedAppInfoModel.kt @@ -17,6 +17,7 @@ import com.tangem.features.walletconnect.connections.entity.VerifiedDAppState import com.tangem.features.walletconnect.connections.entity.WcConnectedAppInfoUM import com.tangem.features.walletconnect.connections.entity.WcNetworkInfoItem import com.tangem.features.walletconnect.connections.entity.WcPrimaryButtonConfig +import com.tangem.features.walletconnect.connections.model.transformers.WcAppSubtitleConverter import com.tangem.utils.coroutines.CoroutineDispatcherProvider import kotlinx.collections.immutable.toImmutableList import kotlinx.coroutines.flow.MutableStateFlow @@ -58,7 +59,7 @@ internal class WcConnectedAppInfoModel @Inject constructor( appIcon = session.sdkModel.appMetaData.icons.firstOrNull().orEmpty(), isVerified = session.securityStatus == CheckDAppResult.SAFE, verifiedDAppState = extractVerifiedState(session), - appSubtitle = session.sdkModel.appMetaData.url, + appSubtitle = WcAppSubtitleConverter.convert(session.sdkModel.appMetaData), walletName = session.wallet.name, networks = session.networks .map { diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/transformers/WcAppInfoTransformer.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/transformers/WcAppInfoTransformer.kt index 9de8083b7c..1c8f2ce99e 100644 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/transformers/WcAppInfoTransformer.kt +++ b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/transformers/WcAppInfoTransformer.kt @@ -29,7 +29,7 @@ internal class WcAppInfoTransformer( verifiedDAppState = dAppVerifiedStateConverter.convert( dAppSession.securityStatus to dAppSession.dAppMetaData.name, ), - appSubtitle = dAppSession.dAppMetaData.url, + appSubtitle = WcAppSubtitleConverter.convert(dAppSession.dAppMetaData), notification = createNotification(dAppSession.securityStatus), walletName = userWallet.name, onWalletClick = onWalletClick, diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/transformers/WcAppSubtitleConverter.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/transformers/WcAppSubtitleConverter.kt new file mode 100644 index 0000000000..0ad62857a1 --- /dev/null +++ b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/connections/model/transformers/WcAppSubtitleConverter.kt @@ -0,0 +1,12 @@ +package com.tangem.features.walletconnect.connections.model.transformers + +import com.tangem.domain.walletconnect.model.sdkcopy.WcAppMetaData +import com.tangem.utils.converter.Converter +import java.net.URI + +internal object WcAppSubtitleConverter : Converter { + override fun convert(value: WcAppMetaData): String { + val uri = URI(value.url.trim()) + return uri.host + } +} \ No newline at end of file diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/converter/WcTransactionAppInfoContentUMConverter.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/converter/WcTransactionAppInfoContentUMConverter.kt index 05a70969d3..621f543caf 100644 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/converter/WcTransactionAppInfoContentUMConverter.kt +++ b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/converter/WcTransactionAppInfoContentUMConverter.kt @@ -1,6 +1,7 @@ package com.tangem.features.walletconnect.transaction.converter import com.tangem.domain.walletconnect.model.WcSession +import com.tangem.features.walletconnect.connections.model.transformers.WcAppSubtitleConverter import com.tangem.features.walletconnect.connections.model.transformers.WcDAppVerifiedStateConverter import com.tangem.features.walletconnect.transaction.entity.common.WcTransactionAppInfoContentUM import com.tangem.utils.converter.Converter @@ -15,7 +16,7 @@ internal class WcTransactionAppInfoContentUMConverter @Inject constructor() : verifiedState = WcDAppVerifiedStateConverter(onVerifiedClick = value.onShowVerifiedAlert).convert( value.session.securityStatus to value.session.sdkModel.appMetaData.name, ), - appSubtitle = value.session.sdkModel.appMetaData.url, + appSubtitle = WcAppSubtitleConverter.convert(value.session.sdkModel.appMetaData), ) data class Input(