π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Fix family storage limit save
ashilkn26f672da0dd9
diff --git a/mobile/apps/photos/lib/gateways/users/users_gateway.dart b/mobile/apps/photos/lib/gateways/users/users_gateway.dartindex 729c90fac5..0212abf05d 100644--- a/mobile/apps/photos/lib/gateways/users/users_gateway.dart+++ b/mobile/apps/photos/lib/gateways/users/users_gateway.dart@@ -263,7 +263,7 @@ class UsersGateway {String? authToken,}) async {final familiesToken = authToken ?? await getFamiliesAuthToken();- await _enteDio.put(+ await _enteDio.post("/family/modify-storage",data: {"id": id,diff --git a/mobile/apps/photos/lib/services/family_service.dart b/mobile/apps/photos/lib/services/family_service.dartindex 7d20ff7b1e..816b785aff 100644--- a/mobile/apps/photos/lib/services/family_service.dart+++ b/mobile/apps/photos/lib/services/family_service.dart@@ -78,7 +78,7 @@ class FamilyService {await usersGateway.removeFamilyMember(member.id);}- Future<void> updateMemberStorageLimit({+ Future<UserDetails> updateMemberStorageLimit({required FamilyMember member,int? storageLimit,}) async {@@ -86,6 +86,7 @@ class FamilyService {id: member.id,storageLimit: storageLimit,);+ return refreshUserDetails();}Future<void> leaveFamily() async {diff --git a/mobile/apps/photos/lib/ui/family/edit_storage_limit_page.dart b/mobile/apps/photos/lib/ui/family/edit_storage_limit_page.dartindex b0483cf62b..38de3ceea1 100644--- a/mobile/apps/photos/lib/ui/family/edit_storage_limit_page.dart+++ b/mobile/apps/photos/lib/ui/family/edit_storage_limit_page.dart@@ -244,12 +244,13 @@ class _EditStorageLimitPageState extends State<EditStorageLimitPage> {return;}try {- await FamilyService.instance.updateMemberStorageLimit(+ final updatedUserDetails =+ await FamilyService.instance.updateMemberStorageLimit(member: widget.member,storageLimit: _selectedStorageLimit,);if (mounted) {- Navigator.of(context).pop(true);+ Navigator.of(context).pop(updatedUserDetails);}} catch (error) {if (!mounted) {diff --git a/mobile/apps/photos/lib/ui/family/family_plan_page.dart b/mobile/apps/photos/lib/ui/family/family_plan_page.dartindex 4d0667e72b..b064d251fb 100644--- a/mobile/apps/photos/lib/ui/family/family_plan_page.dart+++ b/mobile/apps/photos/lib/ui/family/family_plan_page.dart@@ -380,7 +380,8 @@ class _FamilyPlanPageState extends State<FamilyPlanPage> {trailingChevron: true,onTap: () async {Navigator.of(context).pop();- await routeToPage(+ final updatedUserDetails =+ await routeToPage<UserDetails>(context,EditStorageLimitPage(member: member,@@ -389,7 +390,14 @@ class _FamilyPlanPageState extends State<FamilyPlanPage> {colorMap[member.email] ?? colorScheme.greenBase,),);- await _refreshUserDetails();+ if (!mounted) {+ return;+ }+ if (updatedUserDetails != null) {+ setState(() => _userDetails = updatedUserDetails);+ } else {+ await _refreshUserDetails();+ }},),_ActionTile(