diff --git a/lib/data/models/account_model.dart b/lib/data/models/account_model.dart index cf6a1c364..49e92e0fd 100644 --- a/lib/data/models/account_model.dart +++ b/lib/data/models/account_model.dart @@ -111,6 +111,8 @@ abstract class AccountEntity @BuiltValueField(wireName: 'payment_id') String get paymentId; + bool get canMakeIAP => !hasIapPlan && paymentId.isEmpty; + bool get isUpdateAvailable { if (disableAutoUpdate) { return false; diff --git a/lib/ui/app/edit_scaffold.dart b/lib/ui/app/edit_scaffold.dart index 17a08f6c0..4a71e066d 100644 --- a/lib/ui/app/edit_scaffold.dart +++ b/lib/ui/app/edit_scaffold.dart @@ -151,7 +151,8 @@ class EditScaffold extends StatelessWidget { onTap: () async { if (bannerClick != null) { bannerClick(); - } else if (supportsInAppPurchase()) { + } else if (supportsInAppPurchase() && + account.canMakeIAP) { showDialog( context: context, builder: (context) => UpgradeDialog(), diff --git a/lib/ui/app/invoice/invoice_email_view.dart b/lib/ui/app/invoice/invoice_email_view.dart index b1ce622f6..073e5264b 100644 --- a/lib/ui/app/invoice/invoice_email_view.dart +++ b/lib/ui/app/invoice/invoice_email_view.dart @@ -340,7 +340,8 @@ class _InvoiceEmailViewState extends State ), ), onPressed: () { - if (supportsInAppPurchase()) { + if (supportsInAppPurchase() && + state.account.canMakeIAP) { showDialog( context: context, builder: (context) => UpgradeDialog(), diff --git a/lib/ui/reports/reports_screen.dart b/lib/ui/reports/reports_screen.dart index 200ee2462..824d8687e 100644 --- a/lib/ui/reports/reports_screen.dart +++ b/lib/ui/reports/reports_screen.dart @@ -432,7 +432,8 @@ class ReportsScreen extends StatelessWidget { AppButton( label: localization.upgrade.toUpperCase(), onPressed: () { - if (supportsInAppPurchase()) { + if (supportsInAppPurchase() && + state.account.canMakeIAP) { showDialog( context: context, builder: (context) => UpgradeDialog(), diff --git a/lib/ui/settings/account_management.dart b/lib/ui/settings/account_management.dart index dfdb7594f..4c13f7cb9 100644 --- a/lib/ui/settings/account_management.dart +++ b/lib/ui/settings/account_management.dart @@ -389,9 +389,7 @@ class _AccountOverview extends StatelessWidget { ), ), onPressed: () { - if (supportsInAppPurchase() && - !account.hasIapPlan && - account.paymentId.isEmpty) { + if (supportsInAppPurchase() && account.canMakeIAP) { showDialog( context: context, builder: (context) => UpgradeDialog(),