From a377200f5f9d9c36ea35d88b1550291b75e872d9 Mon Sep 17 00:00:00 2001 From: ggurdin <46800240+ggurdin@users.noreply.github.com> Date: Fri, 24 Jan 2025 17:10:40 -0500 Subject: [PATCH] feat: make public profile toggle change public profile boolean instead of DOB (#1585) --- .../pages/settings_learning.dart | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/lib/pangea/learning_settings/pages/settings_learning.dart b/lib/pangea/learning_settings/pages/settings_learning.dart index a5c5cf910..cb21c5d13 100644 --- a/lib/pangea/learning_settings/pages/settings_learning.dart +++ b/lib/pangea/learning_settings/pages/settings_learning.dart @@ -37,15 +37,7 @@ class SettingsLearningController extends State { 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 { } 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) {