Skip to content

Commit

Permalink
fix condition for page type check
Browse files Browse the repository at this point in the history
  • Loading branch information
Ondřej Chrastina committed Jul 21, 2023
1 parent ca9550f commit 041c43d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/shared/ui/menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const isCurrentNavigationItemActive = (navigation: Block_Navigation, router: Nex
const pathSegments = pathWithoutQuerystring.split("/");
const topLevelSegment = pathSegments[1];
const pageLink = navigation.elements.pageLink.linkedItems[0];
return (pageLink?.system.codename === contentTypes.page.codename && pageLink.elements.url.value === topLevelSegment);
return pageLink?.system.type === contentTypes.page.codename && pageLink.elements.url.value === topLevelSegment;
};

const resolveLink = (link: Readonly<Block_Navigation>) => {
Expand Down

0 comments on commit 041c43d

Please sign in to comment.