Skip to content

Commit 00e2122

Browse files
[DSC-2599] fix error message update
1 parent e4e961e commit 00e2122

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/app/shared/form/form.component.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,11 +240,10 @@ export class FormComponent implements OnDestroy, OnInit {
240240
distinctUntilChanged())
241241
.subscribe((errors: FormError[]) => {
242242
const { formGroup, formModel } = this;
243+
const existingMessages = new Set(this.formErrors.map(e => e.message));
244+
243245
errors
244-
.filter((error: FormError) => findIndex(this.formErrors, {
245-
fieldId: error.fieldId,
246-
fieldIndex: error.fieldIndex,
247-
}) === -1)
246+
.filter((error: FormError) => !existingMessages.has(error.message))
248247
.forEach((error: FormError) => {
249248
const { fieldId } = error;
250249
const { fieldIndex } = error;

0 commit comments

Comments
 (0)