Skip to content

Commit

Permalink
fix equality checks (#229)
Browse files Browse the repository at this point in the history
  • Loading branch information
salmma authored Dec 5, 2022
1 parent 1a802bd commit e6a9dc4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/app/services/deactivation-guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class ChangePageGuard
| ComputeResourceViewComponent
| SoftwarePlatformViewComponent
> {
unsavedChanges = false;
savedChanges = false;
constructor(private _router: Router, private utilService: UtilService) {}

canDeactivate(
Expand All @@ -38,7 +38,7 @@ export class ChangePageGuard
| SoftwarePlatformViewComponent
) {
const leavePage = new Subject<boolean>();
if (this.unsavedChanges) {
if (!this.savedChanges) {
const dialogData: ConfirmDialogData = {
title: 'Confirm Page Change',
message:
Expand All @@ -63,7 +63,7 @@ export class ChangePageGuard
}

public objectsEqual<T>(source: T, target: T): boolean {
this.unsavedChanges = !deepEqual(source, target);
return this.unsavedChanges;
this.savedChanges = deepEqual(source, target);
return this.savedChanges;
}
}

0 comments on commit e6a9dc4

Please sign in to comment.