Skip to content

armgit / ente

Public Imported from GitHub
0

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

Direct

Manav Rathi970da9f29c8b
diff --git a/web/packages/new/photos/components/FileViewer5.tsx b/web/packages/new/photos/components/FileViewer5.tsx
index 81c0c87c5d..5d0c64b7bb 100644
--- a/web/packages/new/photos/components/FileViewer5.tsx
+++ b/web/packages/new/photos/components/FileViewer5.tsx
@@ -19,17 +19,18 @@ import PhotoSwipeLightBox from "./ps5/dist/photoswipe-lightbox.esm.js";
import PhotoSwipe from "./ps5/dist/photoswipe.esm.js";
const FileViewer: React.FC = () => {
+ const pswpRef = useRef<PhotoSwipe | undefined>();
console.log(PhotoSwipeLightBox);
useEffect(() => {
- const lightbox = new PhotoSwipeLightBox({
- gallery: "#test-gallery",
- mainClass: "our-extra-pswp-main-class",
- pswpModule: PhotoSwipe,
+ const pswp = new PhotoSwipe({
+ // mainClass: "our-extra-pswp-main-class",
});
- lightbox.init();
+ pswp.init();
+ pswpRef.current = pswp;
return () => {
- lightbox.destroy();
+ pswp.destroy();
+ pswpRef.current = undefined;
};
}, []);
return (