From f4118b631205c5bd62623a9f6cd66fe62e124e03 Mon Sep 17 00:00:00 2001 From: Djorkaeff Alexandre Date: Fri, 3 Jul 2020 11:32:22 -0300 Subject: [PATCH] [REGRESSION] Audio Recording (#2240) Co-authored-by: Diego Mello --- app/containers/MessageBox/Recording.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/containers/MessageBox/Recording.js b/app/containers/MessageBox/Recording.js index d71724fb..d688de3f 100644 --- a/app/containers/MessageBox/Recording.js +++ b/app/containers/MessageBox/Recording.js @@ -94,9 +94,6 @@ export default class extends React.PureComponent { if (!didSucceed) { return onFinish && onFinish(didSucceed); } - if (isAndroid) { - filePath = filePath.startsWith('file://') ? filePath : `file://${ filePath }`; - } const fileInfo = { name: this.name, mime: 'audio/aac', @@ -111,8 +108,9 @@ export default class extends React.PureComponent { finishAudioMessage = async() => { try { this.recording = false; - const filePath = await AudioRecorder.stopRecording(); + let filePath = await AudioRecorder.stopRecording(); if (isAndroid) { + filePath = filePath.startsWith('file://') ? filePath : `file://${ filePath }`; const data = await FileSystem.getInfoAsync(decodeURIComponent(filePath), { size: true }); this.finishRecording(true, filePath, data.size); }