From 6c82fe505b7495d06bec21acbc2a20b653a791ed Mon Sep 17 00:00:00 2001 From: Valentin Mihai Date: Fri, 25 Feb 2022 12:44:45 +0200 Subject: [PATCH] updated base dialog to not verify the changes on closing the window when it's on edit mode --- src/lib/dialog/base-dialog.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/dialog/base-dialog.component.ts b/src/lib/dialog/base-dialog.component.ts index 83f361b..a9ba558 100644 --- a/src/lib/dialog/base-dialog.component.ts +++ b/src/lib/dialog/base-dialog.component.ts @@ -28,7 +28,7 @@ export abstract class BaseDialogComponent extends AutoUnsubscribe implements OnI private readonly _dialogService: ConfirmationDialogService = this._injector.get(ConfirmationDialogService); private readonly _dialog: MatDialog = this._injector.get(MatDialog); - constructor(protected readonly _injector: Injector, protected readonly _dialogRef: MatDialogRef) { + constructor(protected readonly _injector: Injector, protected readonly _dialogRef: MatDialogRef, private readonly _isInEditMode?: boolean) { super(); } @@ -53,7 +53,7 @@ export abstract class BaseDialogComponent extends AutoUnsubscribe implements OnI } close(): void { - if (this.changed) { + if (this._isInEditMode && this.changed) { this._openConfirmDialog().then(result => { if (result in ConfirmOptions) { if (result === ConfirmOptions.CONFIRM) {