From f33fe4266afc7dd0669a0ce16149b400514501d3 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Wed, 15 Oct 2025 22:36:04 +0300 Subject: [PATCH] chore(collection/presentation): don't sync on first render --- apps/client/src/widgets/collections/presentation/index.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/client/src/widgets/collections/presentation/index.tsx b/apps/client/src/widgets/collections/presentation/index.tsx index 856947e41..b384b0220 100644 --- a/apps/client/src/widgets/collections/presentation/index.tsx +++ b/apps/client/src/widgets/collections/presentation/index.tsx @@ -68,6 +68,7 @@ function ButtonOverlay({ containerRef, apiRef }: { containerRef: RefObject }) { const containerRef = useRef(null); const apiRef = useRef(null); + const isFirstRenderRef = useRef(true); useEffect(() => { if (apiRef.current || !containerRef.current) return; @@ -96,7 +97,10 @@ function Presentation({ presentation, apiRef: externalApiRef } : { presentation: }, [ ]); useEffect(() => { - apiRef.current?.sync(); + if (!isFirstRenderRef.current) { + apiRef.current?.sync(); + } + isFirstRenderRef.current = false; }, [ presentation ]); return (