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