more error logging for tts (#1037)

This commit is contained in:
ggurdin 2024-11-18 15:46:11 -05:00 committed by GitHub
parent 3e920a420a
commit c33bf6bc59
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 16 additions and 3 deletions

View file

@ -78,6 +78,7 @@ class InstructionsController {
String transformTargetKey, {
bool showToggle = true,
Widget? customContent,
bool forceShow = false,
}) async {
final bool userLangsSet =
await _pangeaController.userController.areUserLanguagesSet;
@ -85,12 +86,12 @@ class InstructionsController {
return;
}
if (_instructionsShown[key.toString()] ?? false) {
if ((_instructionsShown[key.toString()] ?? false) && !forceShow) {
return;
}
_instructionsShown[key.toString()] = true;
if (key.toggledOff()) {
if (key.toggledOff() && !forceShow) {
return;
}
if (L10n.of(context) == null) {

View file

@ -27,6 +27,10 @@ class MissingVoiceButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
if (kIsWeb || !Platform.isAndroid) {
return const SizedBox();
}
return TextButton(
style: ButtonStyle(
backgroundColor: WidgetStateProperty.all<Color>(

View file

@ -98,6 +98,7 @@ class TtsController {
padding: EdgeInsets.only(top: 12),
child: MissingVoiceButton(),
),
forceShow: true,
);
return;
}
@ -112,6 +113,13 @@ class TtsController {
if (isLanguageFullySupported) {
await speak(text);
} else {
ErrorHandler.logError(
e: 'Language not supported by TTS engine',
data: {
'targetLanguage': targetLanguage,
'availableLangCodes': availableLangCodes,
},
);
await showMissingVoicePopup(context, eventID);
}
}

View file

@ -6,7 +6,7 @@ description: Learn a language while texting your friends.
# Pangea#
publish_to: none
# On version bump also increase the build number for F-Droid
version: 1.23.8+3567
version: 1.23.9+3568
environment:
sdk: ">=3.0.0 <4.0.0"