Updated on 2026-08-14
This commit is contained in:
parent
c41a36519c
commit
a1a6d603d9
1 changed files with 11 additions and 2 deletions
|
|
@ -28,7 +28,8 @@ internal class TokenActionsProvider(
|
|||
|
||||
fun provideActions(tokenActions: TokenActionsState): ImmutableList<TokenActionButtonConfig> {
|
||||
return tokenActions.states
|
||||
.filterIfNodl()
|
||||
.filterIfSingleWithToken()
|
||||
.filterIfS2C()
|
||||
.mapNotNull {
|
||||
mapTokenActionState(
|
||||
actionsState = it,
|
||||
|
|
@ -38,7 +39,7 @@ internal class TokenActionsProvider(
|
|||
.toImmutableList()
|
||||
}
|
||||
|
||||
private fun List<TokenActionsState.ActionState>.filterIfNodl(): List<TokenActionsState.ActionState> {
|
||||
private fun List<TokenActionsState.ActionState>.filterIfSingleWithToken(): List<TokenActionsState.ActionState> {
|
||||
return if (currentWalletProvider().scanResponse.cardTypesResolver.isSingleWalletWithToken()) {
|
||||
filter { it !is TokenActionsState.ActionState.HideToken }
|
||||
} else {
|
||||
|
|
@ -46,6 +47,14 @@ internal class TokenActionsProvider(
|
|||
}
|
||||
}
|
||||
|
||||
private fun List<TokenActionsState.ActionState>.filterIfS2C(): List<TokenActionsState.ActionState> {
|
||||
return if (currentWalletProvider().scanResponse.cardTypesResolver.isStart2Coin()) {
|
||||
filterNot { it is TokenActionsState.ActionState.Buy || it is TokenActionsState.ActionState.Sell }
|
||||
} else {
|
||||
this
|
||||
}
|
||||
}
|
||||
|
||||
private fun mapTokenActionState(
|
||||
actionsState: TokenActionsState.ActionState,
|
||||
cryptoCurrencyStatus: CryptoCurrencyStatus,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue