Skip to content

Commit

Permalink
using download dir for downloaded images
Browse files Browse the repository at this point in the history
  • Loading branch information
balzack committed Jun 7, 2024
1 parent 0430403 commit 03d83b6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export function useImageAsset(asset) {
if (!state.downloaded) {
updateState({ downloaded: true });
const epoch = Math.ceil(Date.now() / 1000);
const dir = Platform.OS === 'ios' ? RNFetchBlob.fs.dirs.DocumentDir : RNFetchBlob.fs.dirs.PictureDir;
const dir = Platform.OS === 'ios' ? RNFetchBlob.fs.dirs.DocumentDir : RNFetchBlob.fs.dirs.DownloadDir;
const path = `${dir}/databag_${epoch}.jpg`
if (state.url.substring(0, 7) === 'file://') {
await RNFS.copyFile(state.url.substring(7).split('?')[0], path);
Expand Down

0 comments on commit 03d83b6

Please sign in to comment.