Browse Source

update logic of showing a confirmation before refreshing the page

pull/19545/head
Sinan997 2 years ago
parent
commit
e28b06a3a1
  1. 3
      npm/ng-packs/packages/theme-shared/src/lib/components/modal/modal.component.ts

3
npm/ng-packs/packages/theme-shared/src/lib/components/modal/modal.component.ts

@ -206,8 +206,7 @@ export class ModalComponent implements OnInit, OnDestroy, DismissableModal {
fromEvent(window, 'beforeunload')
.pipe(takeUntil(this.destroy$))
.subscribe(event => {
// TODO: check this
if (!this.isFormDirty || this.suppressUnsavedChangesWarning) {
if (this.isFormDirty && !this.suppressUnsavedChangesWarning) {
event.preventDefault();
}
});

Loading…
Cancel
Save