Skip to content

Commit 4191984

Browse files
[DSC-2599] fix error message update
1 parent ae770ce commit 4191984

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
@@ -197,11 +197,10 @@ export class FormComponent implements OnDestroy, OnInit {
197197
distinctUntilChanged())
198198
.subscribe((errors: FormError[]) => {
199199
const { formGroup, formModel } = this;
200+
const existingMessages = new Set(this.formErrors.map(e => e.message));
201+
200202
errors
201-
.filter((error: FormError) => findIndex(this.formErrors, {
202-
fieldId: error.fieldId,
203-
fieldIndex: error.fieldIndex
204-
}) === -1)
203+
.filter((error: FormError) => !existingMessages.has(error.message))
205204
.forEach((error: FormError) => {
206205
const { fieldId } = error;
207206
const { fieldIndex } = error;

0 commit comments

Comments
 (0)