diff --git a/features/feed/impl/src/main/kotlin/com/tangem/features/feed/components/market/details/portfolio/impl/model/NewMarketsPortfolioDelegate.kt b/features/feed/impl/src/main/kotlin/com/tangem/features/feed/components/market/details/portfolio/impl/model/NewMarketsPortfolioDelegate.kt index 02e0ec8a02..51bb3b58a7 100644 --- a/features/feed/impl/src/main/kotlin/com/tangem/features/feed/components/market/details/portfolio/impl/model/NewMarketsPortfolioDelegate.kt +++ b/features/feed/impl/src/main/kotlin/com/tangem/features/feed/components/market/details/portfolio/impl/model/NewMarketsPortfolioDelegate.kt @@ -1,5 +1,6 @@ package com.tangem.features.feed.components.market.details.portfolio.impl.model +import com.tangem.blockchainsdk.compatibility.getTokenIdIfL2Network import com.tangem.common.ui.account.AccountTitleUM import com.tangem.common.ui.account.toUM import com.tangem.core.ui.components.bottomsheets.TangemBottomSheetConfig @@ -185,7 +186,10 @@ internal class NewMarketsPortfolioDelegate @AssistedInject constructor( private fun AccountStatusList.filterByRawID(): List { fun AccountStatus.filterByRawID(): List = when (this) { is AccountStatus.CryptoPortfolio -> this.tokenList.flattenCurrencies() - .filter { status -> status.currency.id.rawCurrencyId == currencyRawId } + .filter { status -> + val currencyId = status.currency.id.rawCurrencyId ?: return@filter false + getTokenIdIfL2Network(currencyId.value) == currencyRawId.value + } } return accountStatuses.map { accountStatus -> AccountWithAdded( diff --git a/features/markets/impl/src/main/kotlin/com/tangem/features/markets/portfolio/impl/model/NewMarketsPortfolioDelegate.kt b/features/markets/impl/src/main/kotlin/com/tangem/features/markets/portfolio/impl/model/NewMarketsPortfolioDelegate.kt index eecadfc1a5..a01af9079d 100644 --- a/features/markets/impl/src/main/kotlin/com/tangem/features/markets/portfolio/impl/model/NewMarketsPortfolioDelegate.kt +++ b/features/markets/impl/src/main/kotlin/com/tangem/features/markets/portfolio/impl/model/NewMarketsPortfolioDelegate.kt @@ -1,5 +1,6 @@ package com.tangem.features.markets.portfolio.impl.model +import com.tangem.blockchainsdk.compatibility.getTokenIdIfL2Network import com.tangem.common.ui.account.AccountTitleUM import com.tangem.common.ui.account.toUM import com.tangem.core.ui.components.bottomsheets.TangemBottomSheetConfig @@ -186,7 +187,10 @@ internal class NewMarketsPortfolioDelegate @AssistedInject constructor( private fun AccountStatusList.filterByRawID(): List { fun AccountStatus.filterByRawID(): List = when (this) { is AccountStatus.CryptoPortfolio -> this.tokenList.flattenCurrencies() - .filter { status -> status.currency.id.rawCurrencyId == currencyRawId } + .filter { status -> + val currencyId = status.currency.id.rawCurrencyId ?: return@filter false + getTokenIdIfL2Network(currencyId.value) == currencyRawId.value + } } return accountStatuses.map { accountStatus -> AccountWithAdded(