Updated on 2026-08-14

This commit is contained in:
Tangem 2026-01-28 16:07:23 +07:00
parent 0cfab87af8
commit ee9f8a27b7
2 changed files with 10 additions and 2 deletions

View file

@ -1,5 +1,6 @@
package com.tangem.features.feed.components.market.details.portfolio.impl.model 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.AccountTitleUM
import com.tangem.common.ui.account.toUM import com.tangem.common.ui.account.toUM
import com.tangem.core.ui.components.bottomsheets.TangemBottomSheetConfig import com.tangem.core.ui.components.bottomsheets.TangemBottomSheetConfig
@ -185,7 +186,10 @@ internal class NewMarketsPortfolioDelegate @AssistedInject constructor(
private fun AccountStatusList.filterByRawID(): List<AccountWithAdded> { private fun AccountStatusList.filterByRawID(): List<AccountWithAdded> {
fun AccountStatus.filterByRawID(): List<CryptoCurrencyStatus> = when (this) { fun AccountStatus.filterByRawID(): List<CryptoCurrencyStatus> = when (this) {
is AccountStatus.CryptoPortfolio -> this.tokenList.flattenCurrencies() 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 -> return accountStatuses.map { accountStatus ->
AccountWithAdded( AccountWithAdded(

View file

@ -1,5 +1,6 @@
package com.tangem.features.markets.portfolio.impl.model 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.AccountTitleUM
import com.tangem.common.ui.account.toUM import com.tangem.common.ui.account.toUM
import com.tangem.core.ui.components.bottomsheets.TangemBottomSheetConfig import com.tangem.core.ui.components.bottomsheets.TangemBottomSheetConfig
@ -186,7 +187,10 @@ internal class NewMarketsPortfolioDelegate @AssistedInject constructor(
private fun AccountStatusList.filterByRawID(): List<AccountWithAdded> { private fun AccountStatusList.filterByRawID(): List<AccountWithAdded> {
fun AccountStatus.filterByRawID(): List<CryptoCurrencyStatus> = when (this) { fun AccountStatus.filterByRawID(): List<CryptoCurrencyStatus> = when (this) {
is AccountStatus.CryptoPortfolio -> this.tokenList.flattenCurrencies() 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 -> return accountStatuses.map { accountStatus ->
AccountWithAdded( AccountWithAdded(