Updated on 2026-08-14

This commit is contained in:
Tangem 2023-05-12 17:53:20 +08:00
parent 111ef12825
commit c8e900df8f
2 changed files with 2 additions and 25 deletions

View file

@ -54,16 +54,6 @@ internal class BiometricUserWalletsListManager(
get() = keysRepository.hasSavedEncryptionKeys()
override suspend fun unlock(): CompletionResult<UserWallet> {
// Occurs when user has locked user wallets after unlocking with biometry
// e.g. after biometric storage master key invalidation
if (state.value.hasLockedUserWalletsAfterUnlock) {
return CompletionResult.Failure(
error = UserWalletsListError.UnableToUnlockUserWallets(
cause = IllegalStateException("Permanently locked"),
),
)
}
return unlockWithBiometryInternal()
.mapFailure { error ->
if (error is UserWalletsListError) {
@ -216,10 +206,7 @@ internal class BiometricUserWalletsListManager(
.map {
state.update { prevState ->
val hasLockedUserWallets = prevState.userWallets.any { it.isLocked }
prevState.copy(
isLocked = hasLockedUserWallets,
hasLockedUserWalletsAfterUnlock = hasLockedUserWallets,
)
prevState.copy(isLocked = hasLockedUserWallets)
}
}
}
@ -262,15 +249,6 @@ internal class BiometricUserWalletsListManager(
}
}
}
.doOnFailure { error ->
if (error is UserWalletsListError.EncryptionKeyInvalidated) {
state.update { prevState ->
prevState.copy(
hasLockedUserWalletsAfterUnlock = true,
)
}
}
}
}
private suspend fun getSavedUserWallets(): CompletionResult<List<UserWallet>> {
@ -334,6 +312,5 @@ internal class BiometricUserWalletsListManager(
val userWallets: List<UserWallet> = emptyList(),
val selectedUserWalletId: UserWalletId? = null,
val isLocked: Boolean = true,
val hasLockedUserWalletsAfterUnlock: Boolean = false,
)
}

View file

@ -74,7 +74,7 @@ arrow = "1.2.0-RC"
# region Tangem
tangemBlockchainSdk = "release-app_4.5-215"
#tangemBlockchainSdk = "0.0.1" # Keep it! - used for local builds
tangemCardSdk = "develop-229"
tangemCardSdk = "develop-235"
#tangemCardSdk = "0.0.1" # Keep it! - used for local builds
# endregion Tangem