chore: don't reset instruction profile info on save learning settings, don't update toggle status if value has not changed (#2221)
This commit is contained in:
parent
d828d0fccd
commit
10bd421016
2 changed files with 11 additions and 5 deletions
|
|
@ -138,9 +138,14 @@ extension InstructionsEnumExtension on InstructionsEnum {
|
|||
MatrixState.pangeaController.userController.profile.instructionSettings
|
||||
.getStatus(this);
|
||||
|
||||
void setToggledOff(bool value) =>
|
||||
MatrixState.pangeaController.userController.updateProfile((profile) {
|
||||
profile.instructionSettings.setStatus(this, value);
|
||||
return profile;
|
||||
});
|
||||
void setToggledOff(bool value) {
|
||||
final userController = MatrixState.pangeaController.userController;
|
||||
final instructionSettings = userController.profile.instructionSettings;
|
||||
if (instructionSettings.getStatus(this) == value) return;
|
||||
|
||||
userController.updateProfile((profile) {
|
||||
profile.instructionSettings.setStatus(this, value);
|
||||
return profile;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -124,6 +124,7 @@ class SettingsLearningController extends State<SettingsLearning> {
|
|||
}
|
||||
|
||||
Future<void> resetInstructionTooltips() async {
|
||||
_profile.instructionSettings = InstructionSettings();
|
||||
await showFutureLoadingDialog(
|
||||
context: context,
|
||||
future: () async => pangeaController.userController.updateProfile(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue