Skip to content

Commit

Permalink
Changing footer css import to non blocking
Browse files Browse the repository at this point in the history
  • Loading branch information
bandana147 committed Mar 6, 2025
1 parent 52e176e commit 369e48e
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions libs/navigation/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ export default async function loadBlock(configs, customLib) {
setConfig(clientConfig);
for await (const block of blockConfig) {
const configBlock = configs[block.key];
const config = getConfig();
const gnavSource = `${config?.locale?.contentRoot}/gnav`;
const footerSource = `${config?.locale?.contentRoot}/footer`;

if (configBlock) {
const config = getConfig();
const gnavSource = `${config?.locale?.contentRoot}/gnav`;
const footerSource = `${config?.locale?.contentRoot}/footer`;
if (block.key === 'header') {
try {
const { default: init } = await import('../blocks/global-navigation/global-navigation.js');
Expand All @@ -161,11 +161,9 @@ export default async function loadBlock(configs, customLib) {
}
}
if (block.key === 'footer') {
try {
await import('./footer.css');
} catch (e) {
import('./footer.css').catch(() => {
loadStyle(`${miloLibs}/libs/navigation/footer.css`);
}
});
try {
const { default: init } = await import('../blocks/global-footer/global-footer.js');
await bootstrapBlock(init, { ...block, footerSource });
Expand Down

0 comments on commit 369e48e

Please sign in to comment.