updated the gettingData function to recieve loadMainImage boolean param
This commit is contained in:
parent
acaec11abb
commit
2259854a0d
|
@ -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<number>;
|
||||
|
|
|
@ -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);
|
||||
|
|
2
thirdparty/photoswipe
vendored
2
thirdparty/photoswipe
vendored
|
@ -1 +1 @@
|
|||
Subproject commit ce9b0584dbb855f033be7ba244ae25390b2962f3
|
||||
Subproject commit c8b0db260ccb6f46551f1270e26cf1d1420ad98e
|
Loading…
Reference in a new issue