Updated on 2026-08-14
This commit is contained in:
parent
111ef12825
commit
c8e900df8f
2 changed files with 2 additions and 25 deletions
|
|
@ -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,
|
||||
)
|
||||
}
|
||||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue