diff --git a/src/components/PhotoSwipe/PhotoSwipe.tsx b/src/components/PhotoSwipe/PhotoSwipe.tsx index 3d06a1a2c..1249185bb 100644 --- a/src/components/PhotoSwipe/PhotoSwipe.tsx +++ b/src/components/PhotoSwipe/PhotoSwipe.tsx @@ -17,7 +17,7 @@ interface Iprops { items: any[]; currentIndex?: number; onClose?: () => void; - gettingData?: (instance: any, index: number, item: file) => void; + gettingData?: (instance: any, loadMainImage: boolean, item: file) => void; id?: string; className?: string; favItemIds: Set; diff --git a/src/pages/gallery/index.tsx b/src/pages/gallery/index.tsx index 1f916fb5f..bbce567c5 100644 --- a/src/pages/gallery/index.tsx +++ b/src/pages/gallery/index.tsx @@ -235,7 +235,11 @@ export default function Gallery(props) { ); }; - const getSlideData = async (instance: any, index: number, item: file) => { + const getSlideData = async ( + instance: any, + loadMainImage: boolean, + item: file + ) => { if (!item.msrc) { const url = await DownloadManager.getPreview(item); updateUrl(item.dataIndex)(url); @@ -252,7 +256,7 @@ export default function Gallery(props) { // ignore } } - if (!fetching[item.dataIndex]) { + if (!fetching[item.dataIndex] && loadMainImage) { fetching[item.dataIndex] = true; const url = await DownloadManager.getFile(item); updateSrcUrl(item.dataIndex, url); diff --git a/thirdparty/photoswipe b/thirdparty/photoswipe index ce9b0584d..c8b0db260 160000 --- a/thirdparty/photoswipe +++ b/thirdparty/photoswipe @@ -1 +1 @@ -Subproject commit ce9b0584dbb855f033be7ba244ae25390b2962f3 +Subproject commit c8b0db260ccb6f46551f1270e26cf1d1420ad98e