minor tweak in image

This commit is contained in:
Reinaldo Neto 2023-07-24 20:31:26 -03:00
parent 7e81d41eec
commit 3e75699b0b
1 changed files with 2 additions and 2 deletions

View File

@ -98,6 +98,7 @@ const ImageContainer = React.memo(
if (isDownloadActive(imgUrlToCache)) {
return;
}
setLoading(false);
await handleAutoDownload();
}
};
@ -113,13 +114,12 @@ const ImageContainer = React.memo(
const isAutoDownloadEnabled = fetchAutoDownloadEnabled('imagesPreferenceDownload');
if (isAutoDownloadEnabled || isCurrentUserAuthor) {
await handleDownload();
return;
}
setLoading(false);
};
const handleDownload = async () => {
try {
setLoading(true);
const imageUri = await downloadMediaFile({
downloadUrl: imgUrlToCache,
type: 'image',