Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then((response) => {
const { status, expires, permissions } = response
if (status === 'granted') {
const newRecording = new Audio.Recording()
newRecording
.prepareToRecordAsync(Audio.RECORDING_OPTIONS_PRESET_HIGH_QUALITY)
.then((response) => {
return newRecording.startAsync()
})
.then((response) => {
this.setState({
recordingActive: true,
recording: newRecording,
recordAudioVisible: true,
})
})
.catch((error) => console.log(error))
}
})
.catch((error) => {
.then(() =>
recording.prepareToRecordAsync(
Audio.RECORDING_OPTIONS_PRESET_HIGH_QUALITY
)
)