diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/child/wallet/model/WalletModel.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/child/wallet/model/WalletModel.kt index 8370377f18..ba456f80f5 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/child/wallet/model/WalletModel.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/child/wallet/model/WalletModel.kt @@ -679,7 +679,7 @@ internal class WalletModel @Inject constructor( } private suspend fun unlockWallet(action: WalletsUpdateActionResolver.Action.UnlockWallet) { - withContext(dispatchers.io) { delay(timeMillis = 700) } + delay(timeMillis = 700) stateHolder.update( transformer = UnlockWalletTransformer( @@ -696,7 +696,7 @@ internal class WalletModel @Inject constructor( ) action.unlockedWallets.onEach { userWallet -> - modelScope.launch { fetchWalletContent(userWallet = userWallet) } + fetchWalletContent(userWallet = userWallet) } } diff --git a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/child/wallet/model/WalletsUpdateActionResolver.kt b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/child/wallet/model/WalletsUpdateActionResolver.kt index d498e480a0..4946ef99e9 100644 --- a/features/wallet/impl/src/main/java/com/tangem/feature/wallet/child/wallet/model/WalletsUpdateActionResolver.kt +++ b/features/wallet/impl/src/main/java/com/tangem/feature/wallet/child/wallet/model/WalletsUpdateActionResolver.kt @@ -64,6 +64,15 @@ internal class WalletsUpdateActionResolver @Inject constructor( selectedWallet: UserWallet, ): Action { return when { + isAnyWalletUnlocked(state, wallets) -> { + Action.UnlockWallet( + selectedWallet = selectedWallet, + unlockedWallets = wallets.filterNot(UserWallet::isLocked), + ) + } + isAnyWalletNameChanged(state, wallets) -> { + getRenameWalletsAction(state, wallets) + } isAnyHotWalletUpgraded(state, wallets) -> { getHotWalletsUpgradedAction(state, wallets, selectedWallet) } @@ -79,15 +88,6 @@ internal class WalletsUpdateActionResolver @Inject constructor( selectedWallet = selectedWallet, ) } - isAnyWalletNameChanged(state, wallets) -> { - getRenameWalletsAction(state, wallets) - } - isAnyWalletUnlocked(state, wallets) -> { - Action.UnlockWallet( - selectedWallet = selectedWallet, - unlockedWallets = wallets.filterNot(UserWallet::isLocked), - ) - } isSelectedWalletCardsCountChanged(state, selectedWallet) -> { Action.UpdateWalletCardCount(selectedWallet) }