improvement: Always allow a user to delete a failed cipher

This commit is contained in:
Artem Chepurnoy 2024-03-28 13:45:18 +02:00
parent e3be565699
commit 7cb9e8adbe
No known key found for this signature in database
GPG Key ID: FAC37D0CF674043E
2 changed files with 15 additions and 2 deletions

View File

@ -575,7 +575,15 @@ fun RememberStateFlowScope.createCipherSelectionFlow(
)
}
if (canDelete && selectedCiphers.all { it.deletedDate != null || it.service.remote == null }) {
if (
canDelete &&
selectedCiphers
.all {
it.deletedDate != null ||
it.service.remote == null ||
it.hasError
}
) {
actions += cipherDeleteAction(
removeCipherById = toolbox.removeCipherById,
ciphers = selectedCiphers,

View File

@ -712,7 +712,12 @@ fun vaultViewScreenState(
cipherDeleteAction(
removeCipherById = removeCipherById,
ciphers = listOf(secretOrNull),
).takeIf { canDelete && (secretOrNull.deletedDate != null || secretOrNull.service.remote == null) },
).takeIf {
canDelete &&
(secretOrNull.deletedDate != null ||
secretOrNull.service.remote == null ||
secretOrNull.hasError)
},
),
primaryAction = primaryAction,
items = oh(