Merge pull request #3234 from pangeachat/3233-when-the-word-card-is-open-clicking-one-word-after-another-doesnt-change-the-phonetic-transcription

chore: update phonetic transcription when text changes
This commit is contained in:
ggurdin 2025-06-24 16:06:08 -04:00 committed by GitHub
commit bfcbb6a18a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -51,6 +51,17 @@ class _PhoneticTranscriptionWidgetState
_fetchTranscription();
}
@override
void didUpdateWidget(
covariant PhoneticTranscriptionWidget oldWidget,
) {
super.didUpdateWidget(oldWidget);
if (oldWidget.text != widget.text ||
oldWidget.textLanguage != widget.textLanguage) {
_fetchTranscription();
}
}
Future<void> _fetchTranscription() async {
try {
setState(() {