From bc7f4b3333e2ca6c58f194ca72656ccfdb530df0 Mon Sep 17 00:00:00 2001 From: Igor Kulikov Date: Fri, 23 Aug 2024 18:01:13 +0300 Subject: [PATCH] UI: Menu service: minor fix --- ui-ngx/src/app/core/services/menu.service.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ui-ngx/src/app/core/services/menu.service.ts b/ui-ngx/src/app/core/services/menu.service.ts index 90976e282c..42668c7612 100644 --- a/ui-ngx/src/app/core/services/menu.service.ts +++ b/ui-ngx/src/app/core/services/menu.service.ts @@ -72,10 +72,12 @@ export class MenuService { private updateOpenedMenuSections() { const url = this.router.url; const openedMenuSections = getCurrentOpenedMenuSections(this.store); - this.currentMenuSections.filter(section => section.type === 'toggle' && - (url.startsWith(section.path) || openedMenuSections.includes(section.path))).forEach( - section => section.opened = true - ); + if (this.currentMenuSections?.length) { + this.currentMenuSections.filter(section => section.type === 'toggle' && + (url.startsWith(section.path) || openedMenuSections.includes(section.path))).forEach( + section => section.opened = true + ); + } } private allMenuLinks(sections: Array): Array {