From 134fd9e8d4eca916940f2c1196b1ba85165c7dde Mon Sep 17 00:00:00 2001 From: Tangem Date: Mon, 17 Nov 2025 10:45:51 +0300 Subject: [PATCH] Updated on 2026-08-14 --- .../repository/DefaultUserWalletsListRepository.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/tangem/tap/domain/userWalletList/repository/DefaultUserWalletsListRepository.kt b/app/src/main/java/com/tangem/tap/domain/userWalletList/repository/DefaultUserWalletsListRepository.kt index 3c58898109..c3a79f47fa 100644 --- a/app/src/main/java/com/tangem/tap/domain/userWalletList/repository/DefaultUserWalletsListRepository.kt +++ b/app/src/main/java/com/tangem/tap/domain/userWalletList/repository/DefaultUserWalletsListRepository.kt @@ -288,7 +288,6 @@ internal class DefaultUserWalletsListRepository( override suspend fun unlockAllWallets(): Either = either { val userWallets = userWalletsSync() - val userWalletIds = userWallets.map { it.walletId }.toSet() val biometricKeys = runCatching { userWalletEncryptionKeysRepository.getAllBiometric() }.getOrElse { @@ -309,8 +308,9 @@ internal class DefaultUserWalletsListRepository( removePasswordAttempts(it) } - // if we cant unlock all wallets - if (userWalletIds.all { it in unlockedWalletsIds }.not()) { + // if we cant unlock any of the locked wallets, return error + // (isLocked remains `true` here because we haven't updated the wallets yet) + if (unlockedWallets.any { it.isLocked }.not()) { raise(UnlockWalletError.UnableToUnlock) }