Updated on 2026-08-14
This commit is contained in:
parent
e5c5891b64
commit
f0d2edefc8
1 changed files with 6 additions and 6 deletions
|
|
@ -58,14 +58,14 @@ fun CurrenciesScreen(
|
|||
blockchain,
|
||||
blockchainsAddedOnMainScreen,
|
||||
addedBlockchainsState,
|
||||
addedTokensState,
|
||||
addedTokensState.value,
|
||||
)
|
||||
} else if (token != null) {
|
||||
toggleToken(
|
||||
token,
|
||||
tokensAddedOnMainScreen,
|
||||
addedTokensState,
|
||||
tokensState,
|
||||
tokensState.value,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -122,11 +122,11 @@ private fun toggleBlockchain(
|
|||
blockchain: Blockchain,
|
||||
blockchainsAddedOnMainScreen: List<Blockchain>,
|
||||
addedBlockchainsState: MutableState<List<Blockchain>>,
|
||||
addedTokensState: MutableState<List<TokenWithBlockchain>>
|
||||
addedTokens: List<TokenWithBlockchain>
|
||||
) {
|
||||
val isTryingToRemove = addedBlockchainsState.value.contains(blockchain)
|
||||
val isAddedOnMainScreen = blockchainsAddedOnMainScreen.contains(blockchain)
|
||||
val isTokenWithSameBlockchainFound = addedTokensState.value.any { it.blockchain == blockchain }
|
||||
val isTokenWithSameBlockchainFound = addedTokens.any { it.blockchain == blockchain }
|
||||
|
||||
if (isTryingToRemove) {
|
||||
if (isTokenWithSameBlockchainFound) {
|
||||
|
|
@ -153,11 +153,11 @@ private fun toggleToken(
|
|||
token: TokenWithBlockchain,
|
||||
tokensAddedOnMainScreen: List<TokenWithBlockchain>,
|
||||
addedTokensState: MutableState<List<TokenWithBlockchain>>,
|
||||
tokensState: MutableState<TokensState>,
|
||||
tokensState: TokensState,
|
||||
) {
|
||||
val isTryingToRemove = addedTokensState.value.contains(token)
|
||||
val isAddedOnMainScreen = tokensAddedOnMainScreen.contains(token)
|
||||
val isUnsupportedToken = !tokensState.value.canHandleToken(token)
|
||||
val isUnsupportedToken = !tokensState.canHandleToken(token)
|
||||
|
||||
if (isTryingToRemove) {
|
||||
if (isAddedOnMainScreen) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue