updated the gettingData function to recieve loadMainImage boolean param

This commit is contained in:
Abhinav-grd 2021-02-27 16:13:34 +05:30
parent acaec11abb
commit 2259854a0d
3 changed files with 8 additions and 4 deletions

View file

@ -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>;

View file

@ -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);

@ -1 +1 @@
Subproject commit ce9b0584dbb855f033be7ba244ae25390b2962f3
Subproject commit c8b0db260ccb6f46551f1270e26cf1d1420ad98e