feat: make public profile toggle change public profile boolean instead of DOB (#1585)
This commit is contained in:
parent
88e7c240d7
commit
a377200f5f
1 changed files with 2 additions and 14 deletions
|
|
@ -37,15 +37,7 @@ class SettingsLearningController extends State<SettingsLearning> {
|
|||
pangeaController.userController.updateProfile(
|
||||
(profile) {
|
||||
// set user DOB to younger that 18 if private and older than 18 if public
|
||||
if (isPublic) {
|
||||
profile.userSettings.dateOfBirth = DateTime.now().subtract(
|
||||
const Duration(days: 18 * 365),
|
||||
);
|
||||
} else {
|
||||
profile.userSettings.dateOfBirth = DateTime.now().subtract(
|
||||
const Duration(days: 17 * 365),
|
||||
);
|
||||
}
|
||||
profile.userSettings.publicProfile = isPublic;
|
||||
return profile;
|
||||
},
|
||||
);
|
||||
|
|
@ -102,11 +94,7 @@ class SettingsLearningController extends State<SettingsLearning> {
|
|||
}
|
||||
|
||||
bool get publicProfile =>
|
||||
pangeaController.userController.profile.userSettings.dateOfBirth
|
||||
?.isBefore(
|
||||
DateTime.now().subtract(const Duration(days: 18 * 365)),
|
||||
) ??
|
||||
false;
|
||||
pangeaController.userController.profile.userSettings.publicProfile;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue