fix: grab local uri from assetinfo

This commit is contained in:
Adrian Castro
2024-04-07 19:53:09 +02:00
parent 1ab4b7cec5
commit a5ab7f4767

View File

@@ -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", {