Skip to content

Commit

Permalink
Lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bandana147 committed Nov 25, 2024
1 parent 02581f6 commit 62c2335
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion libs/blocks/global-navigation/global-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ class Gnav {
} else {
let localNav = document.querySelector('.feds-localnav');
if (!localNav) {
lanaLog({ message: `GNAV: Localnav does not include 'localnav' in its name.`, tags: 'errorType=info,module=gnav' });
lanaLog({ message: 'GNAV: Localnav does not include \'localnav\' in its name.', tags: 'errorType=info,module=gnav' });
localNav = toFragment`<div class="feds-localnav"/>`;
this.block.after(localNav);
}
Expand Down
6 changes: 2 additions & 4 deletions libs/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ export async function getGnavSource() {
url = dynamicNav(url, dynamicNavKey);
}
return url;
};
}

async function decorateHeader() {
const breadcrumbs = document.querySelector('.breadcrumbs');
Expand All @@ -783,9 +783,7 @@ async function decorateHeader() {
&& window.sessionStorage.getItem('gnavSource') !== null;
if (!dynamicNavActive && (baseBreadcrumbs || breadcrumbs || autoBreadcrumbs)) header.classList.add('has-breadcrumbs');
const gnavSource = await getGnavSource();
const gnavName = gnavSource.split('/').pop();

if (gnavName.match('localnav') && getMetadata('mobile-gnav-v2') !== 'false') {
if (gnavSource.split('/').pop().match('localnav') && getMetadata('mobile-gnav-v2') !== 'false') {
// Preserving space to avoid CLS issue
const localNavWrapper = createTag('div', { class: 'feds-localnav' });
header.after(localNavWrapper);
Expand Down

0 comments on commit 62c2335

Please sign in to comment.