Dont play tokens on flag activity (#1145)
* don't play target tokens unless the hashcode of the activity model changes * hide immersion mode
This commit is contained in:
parent
a59a6730c9
commit
df60195d39
3 changed files with 5 additions and 16 deletions
|
|
@ -275,8 +275,8 @@ extension SettingCopy on ToolSetting {
|
|||
case ToolSetting.interactiveTranslator:
|
||||
case ToolSetting.interactiveGrammar:
|
||||
case ToolSetting.definitions:
|
||||
return false;
|
||||
case ToolSetting.immersionMode:
|
||||
return false;
|
||||
case ToolSetting.autoIGC:
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ class UserToolSettings {
|
|||
json[ToolSetting.interactiveTranslator.toString()] ?? true,
|
||||
interactiveGrammar:
|
||||
json[ToolSetting.interactiveGrammar.toString()] ?? true,
|
||||
immersionMode: json[ToolSetting.immersionMode.toString()] ?? false,
|
||||
immersionMode: false,
|
||||
definitions: json[ToolSetting.definitions.toString()] ?? true,
|
||||
autoIGC: json[ToolSetting.autoIGC.toString()] ?? true,
|
||||
);
|
||||
|
|
@ -170,9 +170,7 @@ class UserToolSettings {
|
|||
?.content[ToolSetting.interactiveGrammar.toString()]
|
||||
as bool?) ??
|
||||
true,
|
||||
immersionMode: (accountData[ToolSetting.immersionMode.toString()]
|
||||
?.content[ToolSetting.immersionMode.toString()] as bool?) ??
|
||||
false,
|
||||
immersionMode: false,
|
||||
definitions: (accountData[ToolSetting.definitions.toString()]
|
||||
?.content[ToolSetting.definitions.toString()] as bool?) ??
|
||||
true,
|
||||
|
|
|
|||
|
|
@ -53,17 +53,8 @@ class MultipleChoiceActivityState extends State<MultipleChoiceActivity> {
|
|||
@override
|
||||
void didUpdateWidget(covariant MultipleChoiceActivity oldWidget) {
|
||||
super.didUpdateWidget(oldWidget);
|
||||
if (currentRecordModel?.responses.isEmpty ?? false) {
|
||||
// This gets triggered when the activity switches and when the activity is
|
||||
// flagged. Only want to speak the target tokens when the activity switches.
|
||||
final activityEventFuture =
|
||||
widget.practiceCardController.currentActivityCompleter?.future;
|
||||
|
||||
activityEventFuture?.then((event) {
|
||||
final redacted = event?.event.redacted ?? false;
|
||||
if (mounted && !redacted) speakTargetTokens();
|
||||
});
|
||||
|
||||
if (widget.currentActivity.hashCode != oldWidget.currentActivity.hashCode) {
|
||||
speakTargetTokens();
|
||||
setState(() => selectedChoiceIndex = null);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue