From 5abbcd422817ab8a46992437dccae556c826be7f Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Mon, 6 Jan 2025 15:13:50 +0530 Subject: [PATCH] Fix --- web/apps/photos/src/components/PhotoViewer/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/apps/photos/src/components/PhotoViewer/index.tsx b/web/apps/photos/src/components/PhotoViewer/index.tsx index 3295865b17..d61b896ffc 100644 --- a/web/apps/photos/src/components/PhotoViewer/index.tsx +++ b/web/apps/photos/src/components/PhotoViewer/index.tsx @@ -140,7 +140,7 @@ export const PhotoViewer: React.FC = ({ PublicCollectionGalleryContext, ); - const pswpElement = useRef(); + const pswpElement = useRef(undefined); const [photoSwipe, setPhotoSwipe] = useState>(); const [showInfo, setShowInfo] = useState(false); @@ -184,7 +184,7 @@ export const PhotoViewer: React.FC = ({ ); useEffect(() => { - if (!pswpElement) return; + if (!pswpElement.current) return; if (isOpen) { openPhotoSwipe(); }