[FIX] Record audio message throws exception when FileSystem.getInfoAsync is called (#1272)
This commit is contained in:
parent
b795a2fd59
commit
79a936d331
|
@ -5,7 +5,7 @@ import {
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import { AudioRecorder, AudioUtils } from 'react-native-audio';
|
import { AudioRecorder, AudioUtils } from 'react-native-audio';
|
||||||
import { BorderlessButton } from 'react-native-gesture-handler';
|
import { BorderlessButton } from 'react-native-gesture-handler';
|
||||||
import FileSystem from 'expo-file-system';
|
import RNFetchBlob from 'rn-fetch-blob';
|
||||||
|
|
||||||
import styles from './styles';
|
import styles from './styles';
|
||||||
import I18n from '../../i18n';
|
import I18n from '../../i18n';
|
||||||
|
@ -105,7 +105,7 @@ export default class extends React.PureComponent {
|
||||||
this.recording = false;
|
this.recording = false;
|
||||||
const filePath = await AudioRecorder.stopRecording();
|
const filePath = await AudioRecorder.stopRecording();
|
||||||
if (isAndroid) {
|
if (isAndroid) {
|
||||||
const data = await FileSystem.getInfoAsync(decodeURIComponent(filePath));
|
const data = await RNFetchBlob.fs.stat(decodeURIComponent(filePath));
|
||||||
this.finishRecording(true, filePath, data.size);
|
this.finishRecording(true, filePath, data.size);
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
Loading…
Reference in New Issue