Merge pull request #1146 from atmire/w2p-79220_fix-edit-group-navigation-bug

Fix edit group navigation bug
This commit is contained in:
Tim Donohue
2021-05-07 09:42:35 -05:00
committed by GitHub
2 changed files with 8 additions and 1 deletions

View File

@@ -210,4 +210,11 @@ describe('GroupFormComponent', () => {
});
});
describe('ngOnDestroy', () => {
it('does NOT call router.navigate', () => {
component.ngOnDestroy();
expect(router.navigate).toHaveBeenCalledTimes(0);
});
});
});

View File

@@ -405,7 +405,7 @@ export class GroupFormComponent implements OnInit, OnDestroy {
*/
@HostListener('window:beforeunload')
ngOnDestroy(): void {
this.onCancel();
this.groupDataService.cancelEditGroup();
this.subs.filter((sub) => hasValue(sub)).forEach((sub) => sub.unsubscribe());
}