fix: Unable to delete a Password history item with last used date set to null

This commit is contained in:
Artem Chepurnoy 2024-01-19 12:59:54 +02:00
parent dee746a5bc
commit 68f7d0236e
No known key found for this signature in database
GPG Key ID: FAC37D0CF674043E
1 changed files with 5 additions and 1 deletions

View File

@ -165,7 +165,11 @@ data class BitwardenCipher(
val password: String,
val lastUsedDate: Instant? = null,
) {
val id = "$password|timestamp=$lastUsedDate"
val id = kotlin.run {
val timestamp = lastUsedDate
?.takeUnless { it.epochSeconds == 0L }
"$password|timestamp=$timestamp"
}
}
@Serializable