Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix

Manav Rathi5abbcd422817
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<PhotoViewerProps> = ({
PublicCollectionGalleryContext,
);
- const pswpElement = useRef<HTMLDivElement>();
+ const pswpElement = useRef<HTMLDivElement | undefined>(undefined);
const [photoSwipe, setPhotoSwipe] =
useState<Photoswipe<Photoswipe.Options>>();
const [showInfo, setShowInfo] = useState(false);
@@ -184,7 +184,7 @@ export const PhotoViewer: React.FC<PhotoViewerProps> = ({
);
useEffect(() => {
- if (!pswpElement) return;
+ if (!pswpElement.current) return;
if (isOpen) {
openPhotoSwipe();
}