mirror of
https://github.com/bitwarden/android.git
synced 2026-06-04 03:36:32 -05:00
BIT-1704: Edit items in collection bug (#977)
This commit is contained in:
committed by
Álison Fernandes
parent
3266ed65c3
commit
f7150d33cb
@@ -744,7 +744,11 @@ class VaultRepositoryImpl(
|
||||
}
|
||||
|
||||
is UpdateCipherResponseJson.Success -> {
|
||||
vaultDiskSource.saveCipher(userId = userId, cipher = response.cipher)
|
||||
vaultDiskSource.saveCipher(
|
||||
userId = userId,
|
||||
cipher = response.cipher
|
||||
.copy(collectionIds = cipherView.collectionIds),
|
||||
)
|
||||
UpdateCipherResult.Success
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,6 +114,7 @@ fun VaultAddEditState.ViewState.appendFolderAndOwnerData(
|
||||
),
|
||||
availableOwners = activeAccount.toAvailableOwners(
|
||||
collectionViewList = collectionViewList,
|
||||
cipherView = currentContentState.common.originalCipher,
|
||||
isIndividualVaultDisabled = isIndividualVaultDisabled,
|
||||
),
|
||||
),
|
||||
@@ -165,6 +166,7 @@ private fun UserState.Account.toSelectedOwnerId(cipherView: CipherView?): String
|
||||
|
||||
private fun UserState.Account.toAvailableOwners(
|
||||
collectionViewList: List<CollectionView>,
|
||||
cipherView: CipherView?,
|
||||
isIndividualVaultDisabled: Boolean,
|
||||
): List<VaultAddEditState.Owner> =
|
||||
listOfNotNull(
|
||||
@@ -188,7 +190,9 @@ private fun UserState.Account.toAvailableOwners(
|
||||
VaultCollection(
|
||||
id = collection.id.orEmpty(),
|
||||
name = collection.name,
|
||||
isSelected = false,
|
||||
isSelected = cipherView
|
||||
?.collectionIds
|
||||
?.contains(collection.id) == true,
|
||||
)
|
||||
},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user