1
0
mirror of https://github.com/bitwarden/jslib synced 2025-12-06 00:03:29 +00: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:
Thomas Rittson
2021-11-04 07:24:45 +10:00
committed by GitHub
parent e2c72a75f9
commit 2db9e1ce0d

View File

@@ -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);
}
}
}