From b2d8332b7b1890eb4f7dc9ceda3e47240f43e563 Mon Sep 17 00:00:00 2001 From: Roland Osborne Date: Sun, 9 Jun 2024 09:46:44 -0700 Subject: [PATCH] renaming file as jpg --- .../conversation/topicItem/imageAsset/useImageAsset.hook.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/mobile/src/session/conversation/topicItem/imageAsset/useImageAsset.hook.js b/app/mobile/src/session/conversation/topicItem/imageAsset/useImageAsset.hook.js index a8702e2fd..a8ffce9ed 100644 --- a/app/mobile/src/session/conversation/topicItem/imageAsset/useImageAsset.hook.js +++ b/app/mobile/src/session/conversation/topicItem/imageAsset/useImageAsset.hook.js @@ -79,7 +79,7 @@ export function useImageAsset(asset) { updateState({ downloaded: true }); const epoch = Math.ceil(Date.now() / 1000); const dir = Platform.OS === 'ios' ? RNFS.DocumentDirectoryPath : RNFS.DownloadDirectoryPath; - const path = `${dir}/databag_${epoch}.dat` + const path = `${dir}/databag_${epoch}` if (state.url.substring(0, 7) === 'file://') { await RNFS.copyFile(state.url.substring(7).split('?')[0], path); } @@ -88,7 +88,8 @@ export function useImageAsset(asset) { } const block = await RNFS.read(path, 8, 0, 'base64'); if (block === '/9j/4AAQSkY=') { - await RNFS.scanFile(path); + await RNFS.moveFile(path, `${path}.jpg}`); + await RNFS.scanFile(`${path}.jpg}`); } } },