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:
ggurdin 2025-03-25 15:25:57 -04:00 committed by GitHub
parent d828d0fccd
commit 10bd421016
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 5 deletions

View file

@ -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;
});
}
}

View file

@ -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(