Updated on 2026-08-14

This commit is contained in:
Tangem 2024-12-24 16:07:43 +03:00
commit b0539b626f
2 changed files with 3 additions and 3 deletions

View file

@ -17,6 +17,7 @@ import com.tangem.feature.wallet.presentation.wallet.state.model.WalletEvent
import com.tangem.feature.wallet.presentation.wallet.ui.utils.ReviewManagerRequester
import com.tangem.feature.wallet.presentation.wallet.ui.utils.animateScrollByIndex
import com.tangem.feature.wallet.presentation.wallet.ui.utils.demonstrateScrolling
import kotlinx.coroutines.delay
@Suppress("LongParameterList")
@Composable
@ -37,6 +38,7 @@ internal fun WalletEventEffect(
onTrigger = { value ->
when (value) {
is WalletEvent.ChangeWallet -> {
delay(timeMillis = 1000) // to let compose time to start drawing otherwise animation doesnt work
onAutoScrollSet()
walletsListState.animateScrollByIndex(prevIndex = selectedWalletIndex, newIndex = value.index)
}

View file

@ -363,7 +363,7 @@ internal class WalletViewModel @Inject constructor(
)
}
private suspend fun addWallet(action: WalletsUpdateActionResolver.Action.AddWallet) {
private fun addWallet(action: WalletsUpdateActionResolver.Action.AddWallet) {
walletScreenContentLoader.load(
userWallet = action.selectedWallet,
clickIntents = clickIntents,
@ -379,8 +379,6 @@ internal class WalletViewModel @Inject constructor(
),
)
withContext(dispatchers.io) { delay(timeMillis = 1000) }
scrollToWallet(index = action.selectedWalletIndex)
}