diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/ui/WalletEventEffect.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/ui/WalletEventEffect.kt index 19cd88f97f..5bf812ae5e 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/ui/WalletEventEffect.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/ui/WalletEventEffect.kt @@ -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) } diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/WalletViewModel.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/WalletViewModel.kt index 785d29d72e..145ad36baa 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/WalletViewModel.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/presentation/wallet/viewmodels/WalletViewModel.kt @@ -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) }