diff --git a/app/views/AttachmentView.js b/app/views/AttachmentView.js index 3f4adfec7..c07ed71b9 100644 --- a/app/views/AttachmentView.js +++ b/app/views/AttachmentView.js @@ -121,8 +121,9 @@ class AttachmentView extends React.Component { const extension = image_url ? `.${ mime.extension(image_type) || 'jpg' }` : `.${ mime.extension(video_type) || 'mp4' }`; const documentDir = `${ RNFetchBlob.fs.dirs.DocumentDir }/`; const path = `${ documentDir + SHA256(url) + extension }`; - const file = await RNFetchBlob.config({ path }).fetch('GET', mediaAttachment).then(res => res.path()); - await CameraRoll.save(file, { album: 'Rocket.Chat' }); + const file = await RNFetchBlob.config({ path }).fetch('GET', mediaAttachment); + await CameraRoll.save(path, { album: 'Rocket.Chat' }); + await file.flush(); EventEmitter.emit(LISTENER, { message: I18n.t('saved_to_gallery') }); } catch (e) { EventEmitter.emit(LISTENER, { message: I18n.t(image_url ? 'error-save-image' : 'error-save-video') });