Do not overlay offline ciphers with merge conflicts

This commit is contained in:
Matt Gibson 2024-10-24 15:22:51 -07:00
parent ee61c83409
commit d4d980b576
No known key found for this signature in database
GPG key ID: 7CBCA182C13B0912

View file

@ -151,7 +151,8 @@ class VaultDiskSourceImpl(
getOfflineCiphers(userId), getOfflineCiphers(userId),
{ ciphers, offlineCiphers -> { ciphers, offlineCiphers ->
val overlaid = ciphers.map { cipher -> val overlaid = ciphers.map { cipher ->
offlineCiphers.find { it.id == cipher.id }?.toSdkCipherJson() ?: cipher // only overlay ciphers that have not had a merge conflict
offlineCiphers.filter { !it.mergeConflict }.find { it.id == cipher.id }?.toSdkCipherJson() ?: cipher
} }
// TODO add new offline items to the vault list // TODO add new offline items to the vault list
// val newOffline = offlineCiphers.filter { it.id.startsWith("create") }.map { it.toSdkCipherJson() } // val newOffline = offlineCiphers.filter { it.id.startsWith("create") }.map { it.toSdkCipherJson() }