fix: display speech translation error
This commit is contained in:
parent
9b37fd884c
commit
b37a455a34
1 changed files with 9 additions and 3 deletions
|
|
@ -176,7 +176,7 @@ class SelectModeController {
|
|||
return;
|
||||
}
|
||||
|
||||
if (l1Code == null) {
|
||||
if (l1Code == null || l2Code == null) {
|
||||
transcriptionState.value = const AsyncState.error(
|
||||
'Language code or message event is null',
|
||||
);
|
||||
|
|
@ -211,8 +211,14 @@ class SelectModeController {
|
|||
if (l1Code == null ||
|
||||
l2Code == null ||
|
||||
speechTranslationState.value is AsyncLoading ||
|
||||
speechTranslationState.value is AsyncLoaded ||
|
||||
transcriptionState.value is AsyncError) {
|
||||
speechTranslationState.value is AsyncLoaded) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (transcriptionState.value is AsyncError) {
|
||||
speechTranslationState.value = AsyncState.error(
|
||||
(transcriptionState.value as AsyncError).error,
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue