Updated on 2026-08-14

This commit is contained in:
Tangem 2025-12-29 10:27:08 +03:00
parent c0f4f15b5d
commit 7a08266a06
2 changed files with 11 additions and 11 deletions

View file

@ -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)
}
}

View file

@ -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)
}