toast error when recording save failed

This commit is contained in:
an-lee
2024-02-20 09:05:40 +08:00
parent 650a00b6a4
commit ce49b68ba3
3 changed files with 11 additions and 4 deletions

View File

@@ -140,8 +140,13 @@ const RecordButtonPopover = (props: {
record.on("record-end", async (blob: Blob) => {
const duration = Date.now() - startAt;
const output = await transcode(blob);
props.onRecordEnd(output, duration);
try {
const output = await transcode(blob);
props.onRecordEnd(output, duration);
} catch (e) {
console.error(e);
toast.error(t("failedToSaveRecording"));
}
});
RecordPlugin.getAvailableAudioDevices()