fix: display speech translation error

This commit is contained in:
ggurdin 2025-11-17 13:00:09 -05:00
parent 9b37fd884c
commit b37a455a34
No known key found for this signature in database
GPG key ID: A01CB41737CBB478

View file

@ -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;
}