Skip to content

Commit 3bfabc2

Browse files
committed
perf(landing): load preview eagerly when IntersectionObserver is unavailable
Graceful degradation for browsers/WebViews without IntersectionObserver — set inView immediately instead of leaving the preview stuck on its placeholder (addresses Greptile P2).
1 parent 7ba2b82 commit 3bfabc2

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

apps/sim/app/(landing)/components/landing-preview/landing-preview-mount.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ export function LandingPreviewMount({ autoplay, view, workflowId }: LandingPrevi
5252

5353
useEffect(() => {
5454
if (inView) return
55+
// Graceful degradation: without IntersectionObserver support, load eagerly
56+
// rather than leave the preview stuck on its placeholder.
57+
if (typeof IntersectionObserver === 'undefined') {
58+
setInView(true)
59+
return
60+
}
5561
const el = ref.current
5662
if (!el) return
5763
const observer = new IntersectionObserver(

0 commit comments

Comments
 (0)