From 172d0d986b9b5bdd97d1aab7d23256d4cf4e3d05 Mon Sep 17 00:00:00 2001 From: Kristof De Langhe Date: Tue, 19 May 2020 12:08:59 +0200 Subject: [PATCH] 68067: JSON.stringify to compare menu section changes --- src/app/shared/menu/menu.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/shared/menu/menu.component.ts b/src/app/shared/menu/menu.component.ts index 142471224d..29a3e0a30a 100644 --- a/src/app/shared/menu/menu.component.ts +++ b/src/app/shared/menu/menu.component.ts @@ -3,7 +3,7 @@ import { Observable } from 'rxjs/internal/Observable'; import { MenuService } from '../../shared/menu/menu.service'; import { MenuID } from '../../shared/menu/initial-menus-state'; import { MenuSection } from '../../shared/menu/menu.reducer'; -import { distinctUntilChanged, first, map } from 'rxjs/operators'; +import { distinctUntilChanged, first, map, tap } from 'rxjs/operators'; import { GenericConstructor } from '../../core/shared/generic-constructor'; import { hasValue } from '../empty.util'; import { MenuSectionComponent } from './menu-section/menu-section.component'; @@ -72,7 +72,7 @@ export class MenuComponent implements OnInit { this.menuCollapsed = this.menuService.isMenuCollapsed(this.menuID); this.menuPreviewCollapsed = this.menuService.isMenuPreviewCollapsed(this.menuID); this.menuVisible = this.menuService.isMenuVisible(this.menuID); - this.sections = this.menuService.getMenuTopSections(this.menuID).pipe(distinctUntilChanged((x, y) => x.length === y.length)); + this.sections = this.menuService.getMenuTopSections(this.menuID).pipe(distinctUntilChanged((x, y) => JSON.stringify(x) === JSON.stringify(y))); this.sections.subscribe((sections: MenuSection[]) => { sections.forEach((section: MenuSection) => { this.sectionInjectors.set(section.id, this.getSectionDataInjector(section));