Skip to content

Commit

Permalink
added condition to check if profile exists
Browse files Browse the repository at this point in the history
  • Loading branch information
tishoyanchev committed Aug 30, 2024
1 parent 9310b28 commit 7db5b7b
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions packages/components/src/components/navigation/navbar/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@ export class Navbar {
} else if(leftAssignedNodes.length !== 0) {
this.searchBarIsOpen = 'left'
}
navbarProfile.hideComponent()

if(navbarProfile) {
navbarProfile.hideComponent()
}

for(let l = 0; l < leftMenuItems.length; l++) {
if(!topRowWrapper.classList.contains('expand')) {
Expand All @@ -156,7 +159,9 @@ export class Navbar {
const { navbarProfile, leftMenuItems, rightMenuItems, topRowWrapper } = this.getWrappers();
this.searchBarIsOpen = undefined;

navbarProfile.showComponent()
if(navbarProfile) {
navbarProfile.showComponent()
}

for(let l = 0; l < leftMenuItems.length; l++) {
if(!topRowWrapper.classList.contains('expand')) {
Expand Down Expand Up @@ -434,8 +439,10 @@ export class Navbar {
//right-side
const rightMenuItems = this.getMobileMenuBottom()
const navbarProfileItem = this.el.querySelector('ifx-navbar-profile')
const showProfileItemLabel = navbarProfileItem.getAttribute('show-label');
navbarProfileItem.setAttribute('show-label', showProfileItemLabel)
if(navbarProfileItem) {
const showProfileItemLabel = navbarProfileItem.getAttribute('show-label');
navbarProfileItem.setAttribute('show-label', showProfileItemLabel)
}

for(let i = 0; i < rightMenuItems.length; i++) {
rightMenuItems[i].setAttribute('slot', 'right-item')
Expand Down

0 comments on commit 7db5b7b

Please sign in to comment.