fix: update base/target language on dropdown value change in activity planner (#1869)

This commit is contained in:
ggurdin 2025-02-20 14:07:02 -05:00 committed by GitHub
parent 820e79593c
commit 8a4ca7ee98
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 19 additions and 9 deletions

View file

@ -43,7 +43,6 @@ import '../../widgets/matrix.dart';
import 'package:fluffychat/utils/tor_stub.dart'
if (dart.library.html) 'package:tor_detector_web/tor_detector_web.dart';
enum PopupMenuAction {
settings,
invite,

View file

@ -19,6 +19,7 @@ import 'package:fluffychat/pangea/instructions/instructions_enum.dart';
import 'package:fluffychat/pangea/instructions/instructions_inline_tooltip.dart';
import 'package:fluffychat/pangea/learning_settings/constants/language_constants.dart';
import 'package:fluffychat/pangea/learning_settings/enums/language_level_type_enum.dart';
import 'package:fluffychat/pangea/learning_settings/utils/language_list_util.dart';
import 'package:fluffychat/pangea/learning_settings/widgets/p_language_dropdown.dart';
import 'package:fluffychat/widgets/matrix.dart';
@ -276,10 +277,15 @@ class ActivityPlannerPageState extends State<ActivityPlannerPage> {
PLanguageDropdown(
languages: MatrixState
.pangeaController.pLanguageStore.baseOptions,
onChange: (val) =>
_selectedLanguageOfInstructions = val.langCode,
initialLanguage: MatrixState
.pangeaController.languageController.userL1,
onChange: (val) => setState(
() => _selectedLanguageOfInstructions = val.langCode,
),
initialLanguage: _selectedLanguageOfInstructions != null
? PangeaLanguage.byLangCode(
_selectedLanguageOfInstructions!,
)
: MatrixState
.pangeaController.languageController.userL1,
isL2List: false,
decorationText:
L10n.of(context).languageOfInstructionsLabel,
@ -288,10 +294,15 @@ class ActivityPlannerPageState extends State<ActivityPlannerPage> {
PLanguageDropdown(
languages: MatrixState
.pangeaController.pLanguageStore.targetOptions,
onChange: (val) =>
_selectedTargetLanguage = val.langCode,
initialLanguage: MatrixState
.pangeaController.languageController.userL2,
onChange: (val) => setState(
() => _selectedTargetLanguage = val.langCode,
),
initialLanguage: _selectedTargetLanguage != null
? PangeaLanguage.byLangCode(
_selectedTargetLanguage!,
)
: MatrixState
.pangeaController.languageController.userL2,
decorationText: L10n.of(context).targetLanguageLabel,
isL2List: true,
),