Skip to content

Commit

Permalink
fix: added await on checkCache
Browse files Browse the repository at this point in the history
  • Loading branch information
OtavioStasiak authored and diegolmello committed Dec 16, 2024
1 parent 300e5af commit fe93aea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/containers/message/hooks/useMediaAutoDownload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ export const useMediaAutoDownload = ({
urlToCache: url
});
if (result?.exists && !isEncrypted) {
if(!currentFile?.title_link) {
persistMessageWithCacheFile(id, result.uri, file.encryption, file.image_url || url);
if (!currentFile?.title_link) {
await persistMessageWithCacheFile(id, result.uri, file.encryption, file.image_url || url);
}

updateCurrentFile(result.uri);
}
return result?.exists;
Expand Down

0 comments on commit fe93aea

Please sign in to comment.