From a5ab7f47674f53942ffe0c8b76e6a4702c3a729a Mon Sep 17 00:00:00 2001 From: Adrian Castro <22133246+castdrian@users.noreply.github.com> Date: Sun, 7 Apr 2024 19:53:09 +0200 Subject: [PATCH] fix: grab local uri from assetinfo --- apps/expo/src/hooks/useDownloadManager.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/expo/src/hooks/useDownloadManager.tsx b/apps/expo/src/hooks/useDownloadManager.tsx index c0d50b5..9517d8c 100644 --- a/apps/expo/src/hooks/useDownloadManager.tsx +++ b/apps/expo/src/hooks/useDownloadManager.tsx @@ -151,11 +151,12 @@ export const useDownloadManager = () => { updateDownloadItem(download.id, { status: "importing" }); const asset = await MediaLibrary.createAssetAsync(fileUri); + const { localUri } = await MediaLibrary.getAssetInfoAsync(asset); await FileSystem.deleteAsync(fileUri); updateDownloadItem(download.id, { status: "finished", - localPath: asset.uri, + localPath: localUri, }); console.log("File saved to media library and original deleted"); showToast("Download finished", {