Skip to content

Commit

Permalink
chore: improves debug
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardoformiga committed Dec 20, 2024
1 parent 90504b1 commit 1317e9c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/core/src/components/cms/RenderSections.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,18 @@ export const LazyLoadingSection = ({
}) => {
const { cart: displayCart, modal: displayModal } = useUI()
if (SECTIONS_OUT_OF_VIEWPORT.includes(sectionName)) {
if (debug) {
console.log(`section SECTIONS_OUT_OF_VIEWPORT '${sectionName}' VISIBLE`)
}
const shouldLoad =
isInteractive ||
(sectionName === 'CartSidebar' && displayCart) ||
(sectionName === 'RegionModal' && displayModal)

if (debug) {
console.log(
`section SECTIONS_OUT_OF_VIEWPORT '${sectionName}' shouldLoad:`,
shouldLoad
)
}

return shouldLoad ? <>{children}</> : null
}

Expand Down

0 comments on commit 1317e9c

Please sign in to comment.