more error logging for tts (#1037)
This commit is contained in:
parent
3e920a420a
commit
c33bf6bc59
4 changed files with 16 additions and 3 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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>(
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue