Skip to content

Commit

Permalink
fix: revert changes of two previous commits
Browse files Browse the repository at this point in the history
  • Loading branch information
Zherdetska Alona, IT21.1 committed Oct 4, 2024
1 parent e9dda1e commit f62a363
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/internet-header/src/models/header.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export interface NavMainEntity {
isActive?: boolean;
isActiveOverride?: boolean;
noFlyout?: boolean;
flyout?: FlyoutEntity[];
flyout: FlyoutEntity[];
}

export interface FlyoutEntity {
Expand Down
13 changes: 7 additions & 6 deletions packages/internet-header/src/services/route.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,13 @@ const resetOverrideConfig = (config: NavMainEntity[]): NavMainEntity[] => {
return config.map(nav => ({
...nav,
isActiveOverride: false,
// Initialize flyout as an empty array if it's undefined
flyout:
nav.flyout?.map(flyout => ({
...flyout,
linkList: flyout.linkList.map(link => ({ ...link, isActiveOverride: false })),
})) || [], // Fallback to an empty array if nav.flyout is undefined
// Check if flyout exists before attempting to map
flyout: nav.flyout
? nav.flyout.map(flyout => ({
...flyout,
linkList: flyout.linkList.map(link => ({ ...link, isActiveOverride: false })),
}))
: [],
}));
};

Expand Down

0 comments on commit f62a363

Please sign in to comment.