Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

Commit

Permalink
Allow folks with add_on to activate family (#1500)
Browse files Browse the repository at this point in the history
  • Loading branch information
ua741 authored Nov 15, 2023
2 parents 292dc0f + bf08e93 commit 12db3e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/models/user_details.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down
3 changes: 2 additions & 1 deletion lib/services/billing_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 12db3e8

Please sign in to comment.