mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 07:43:35 +00:00
[PM-9190] Use updateFn for patchCipher so that the current CipherView is available for context (#10258)
This commit is contained in:
@@ -110,12 +110,15 @@ export class ItemDetailsSectionComponent implements OnInit {
|
||||
map(() => this.itemDetailsForm.getRawValue()),
|
||||
)
|
||||
.subscribe((value) => {
|
||||
this.cipherFormContainer.patchCipher({
|
||||
name: value.name,
|
||||
organizationId: value.organizationId,
|
||||
folderId: value.folderId,
|
||||
collectionIds: value.collectionIds?.map((c) => c.id) || [],
|
||||
favorite: value.favorite,
|
||||
this.cipherFormContainer.patchCipher((cipher) => {
|
||||
Object.assign(cipher, {
|
||||
name: value.name,
|
||||
organizationId: value.organizationId,
|
||||
folderId: value.folderId,
|
||||
collectionIds: value.collectionIds?.map((c) => c.id) || [],
|
||||
favorite: value.favorite,
|
||||
} as CipherView);
|
||||
return cipher;
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -212,7 +215,6 @@ export class ItemDetailsSectionComponent implements OnInit {
|
||||
this.itemDetailsForm.controls.favorite.enable();
|
||||
this.itemDetailsForm.controls.folderId.enable();
|
||||
} else if (this.config.mode === "edit") {
|
||||
//
|
||||
this.readOnlyCollections = this.collections
|
||||
.filter(
|
||||
(c) => c.readOnly && this.originalCipherView.collectionIds.includes(c.id as CollectionId),
|
||||
|
||||
Reference in New Issue
Block a user