Allow folks with add_on to activate family

This commit is contained in:
Neeraj Gupta 2023-11-15 20:14:48 +05:30
parent 172fc66f76
commit bf08e938ff
2 changed files with 6 additions and 1 deletions

View file

@ -33,6 +33,10 @@ class UserDetails {
return familyData?.members?.isNotEmpty ?? false;
}
bool hasPaidAddon() {
return bonusData?.getAddOnBonuses().isNotEmpty ?? false;
}
bool isFamilyAdmin() {
assert(isPartOfFamily(), "verify user is part of family before calling");
final FamilyMember currentUserMember = familyData!.members!

View file

@ -166,7 +166,8 @@ class BillingService {
BuildContext context,
UserDetails userDetails,
) async {
if (userDetails.subscription.productID == freeProductID) {
if (userDetails.subscription.productID == freeProductID &&
!userDetails.hasPaidAddon()) {
await showErrorDialog(
context,
S.of(context).familyPlans,