Fix microphone permission checking for audio recording

See [#5580][0].

[0]: https://github.com/signalapp/Signal-Desktop/pull/5580
This commit is contained in:
David Sanders 2021-10-27 11:16:09 -05:00 committed by Evan Hahn
parent 1dc353f089
commit 79b3b6408e
8 changed files with 69 additions and 43 deletions

View file

@ -77,8 +77,10 @@ function startRecording(): ThunkAction<
return;
}
let recordingStarted = false;
try {
await recorder.start();
recordingStarted = await recorder.start();
} catch (err) {
dispatch({
type: ERROR_RECORDING,
@ -87,10 +89,12 @@ function startRecording(): ThunkAction<
return;
}
dispatch({
type: START_RECORDING,
payload: undefined,
});
if (recordingStarted) {
dispatch({
type: START_RECORDING,
payload: undefined,
});
}
};
}