π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Fix null handling for absent familyData; align auth freePlan to contract
Manav Rathi284f21be4992
diff --git a/mobile/apps/auth/lib/models/billing_plan.dart b/mobile/apps/auth/lib/models/billing_plan.dartindex f5f7486aa0..12888da0e5 100644--- a/mobile/apps/auth/lib/models/billing_plan.dart+++ b/mobile/apps/auth/lib/models/billing_plan.dart@@ -2,20 +2,18 @@ import 'dart:convert';class BillingPlans {final List<BillingPlan> plans;- final FreePlan? freePlan;+ final FreePlan freePlan;BillingPlans({required this.plans, required this.freePlan});Map<String, dynamic> toMap() {return {'plans': plans.map((x) => x.toMap()).toList(),- 'freePlan': freePlan?.toMap(),+ 'freePlan': freePlan.toMap(),};}- static BillingPlans fromMap(Map<String, dynamic>? map) {- if (map == null) return BillingPlans(plans: [], freePlan: null);-+ static BillingPlans fromMap(Map<String, dynamic> map) {return BillingPlans(plans: List<BillingPlan>.from(map['plans']?.map((x) => BillingPlan.fromMap(x)),diff --git a/mobile/apps/photos/lib/models/user_details.dart b/mobile/apps/photos/lib/models/user_details.dartindex 0833830173..356acaf60b 100644--- a/mobile/apps/photos/lib/models/user_details.dart+++ b/mobile/apps/photos/lib/models/user_details.dart@@ -132,7 +132,7 @@ class UserDetails {(map['storageBonus'] ?? 0) as int,(map['sharedCollectionsCount'] ?? 0) as int,Subscription.fromMap(map['subscription']),- FamilyData.fromMap(map['familyData']),+ map['familyData'] != null ? FamilyData.fromMap(map['familyData']) : null,ProfileData.fromJson(map['profileData']),BonusData.fromJson(map['bonusData']),);diff --git a/mobile/packages/accounts/lib/models/user_details.dart b/mobile/packages/accounts/lib/models/user_details.dartindex 709eb64531..d4994ba4b1 100644--- a/mobile/packages/accounts/lib/models/user_details.dart+++ b/mobile/packages/accounts/lib/models/user_details.dart@@ -135,7 +135,7 @@ class UserDetails {(map['storageBonus'] ?? 0) as int,(map['sharedCollectionsCount'] ?? 0) as int,Subscription.fromMap(map['subscription']),- FamilyData.fromMap(map['familyData']),+ map['familyData'] != null ? FamilyData.fromMap(map['familyData']) : null,ProfileData.fromJson(map['profileData']),BonusData.fromJson(map['bonusData']),LockerFamilyUsage.fromJson(map['lockerFamilyUsage']),