mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-23 11:56:00 +01:00
[Linked fields] Reset linkedIds if cipher type changes (#535)
* Reset linkedIds if cipher type changes * Only reset linkedId if !editmode
This commit is contained in:
parent
e2c72a75f9
commit
2db9e1ce0d
@ -102,5 +102,11 @@ export class AddEditCustomFieldsComponent implements OnChanges {
|
||||
this.cipher.linkedFieldOptions.forEach((linkedFieldOption, id) =>
|
||||
options.push({ name: this.i18nService.t(linkedFieldOption.i18nKey), value: id }));
|
||||
this.linkedFieldOptions = options.sort(Utils.getSortFunction(this.i18nService, 'name'));
|
||||
|
||||
if (!this.editMode) {
|
||||
this.cipher.fields
|
||||
.filter(f => f.type = FieldType.Linked)
|
||||
.forEach(f => f.linkedId = this.linkedFieldOptions[0].value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user