Skip to content

Commit

Permalink
Fixing unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
bandana147 committed Jan 22, 2025
1 parent 5af059c commit 9e15a53
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libs/blocks/global-navigation/utilities/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -548,14 +548,14 @@ export const dropWhile = (xs, f) => {

export function isLocalNav() {
if (isDesktop.matches) return false;
const { locale } = getConfig();
const { locale = {} } = getConfig();
const gnavSource = getMetadata('gnav-source') || `${locale.contentRoot}/gnav`;
const newNavEnabled = new URLSearchParams(window.location.search).get('newNav') || getMetadata('mobile-gnav-v2') !== 'off';
return gnavSource.split('/').pop().startsWith('localnav-') && newNavEnabled;
}

export function getGnavHeight() {
let topHeight = document.querySelector('header').offsetHeight;
let topHeight = document.querySelector('header')?.offsetHeight || 0;
if (isLocalNav()) {
const localNav = document.querySelector('.feds-localnav');
topHeight = localNav.offsetHeight || DEFAULT_LOCALNAV_HEIGHT;
Expand Down

0 comments on commit 9e15a53

Please sign in to comment.