mirror of
https://github.com/balzack/databag.git
synced 2025-02-11 11:09:17 +00:00
using download dir for downloaded images
This commit is contained in:
parent
0430403e01
commit
03d83b6be4
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user