[FIX] Record audio message throws exception when FileSystem.getInfoAsync is called (#1272)

This commit is contained in:
Diego Mello 2019-10-04 10:38:57 -03:00 committed by GitHub
parent b795a2fd59
commit 79a936d331
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -5,7 +5,7 @@ import {
} from 'react-native';
import { AudioRecorder, AudioUtils } from 'react-native-audio';
import { BorderlessButton } from 'react-native-gesture-handler';
import FileSystem from 'expo-file-system';
import RNFetchBlob from 'rn-fetch-blob';
import styles from './styles';
import I18n from '../../i18n';
@ -105,7 +105,7 @@ export default class extends React.PureComponent {
this.recording = false;
const filePath = await AudioRecorder.stopRecording();
if (isAndroid) {
const data = await FileSystem.getInfoAsync(decodeURIComponent(filePath));
const data = await RNFetchBlob.fs.stat(decodeURIComponent(filePath));
this.finishRecording(true, filePath, data.size);
}
} catch (err) {