Improve checks to support IAP
This commit is contained in:
parent
50ff6a76cc
commit
a32c1fab29
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -151,7 +151,8 @@ class EditScaffold extends StatelessWidget {
|
|||
onTap: () async {
|
||||
if (bannerClick != null) {
|
||||
bannerClick();
|
||||
} else if (supportsInAppPurchase()) {
|
||||
} else if (supportsInAppPurchase() &&
|
||||
account.canMakeIAP) {
|
||||
showDialog<void>(
|
||||
context: context,
|
||||
builder: (context) => UpgradeDialog(),
|
||||
|
|
|
|||
|
|
@ -340,7 +340,8 @@ class _InvoiceEmailViewState extends State<InvoiceEmailView>
|
|||
),
|
||||
),
|
||||
onPressed: () {
|
||||
if (supportsInAppPurchase()) {
|
||||
if (supportsInAppPurchase() &&
|
||||
state.account.canMakeIAP) {
|
||||
showDialog<void>(
|
||||
context: context,
|
||||
builder: (context) => UpgradeDialog(),
|
||||
|
|
|
|||
|
|
@ -432,7 +432,8 @@ class ReportsScreen extends StatelessWidget {
|
|||
AppButton(
|
||||
label: localization.upgrade.toUpperCase(),
|
||||
onPressed: () {
|
||||
if (supportsInAppPurchase()) {
|
||||
if (supportsInAppPurchase() &&
|
||||
state.account.canMakeIAP) {
|
||||
showDialog<void>(
|
||||
context: context,
|
||||
builder: (context) => UpgradeDialog(),
|
||||
|
|
|
|||
|
|
@ -389,9 +389,7 @@ class _AccountOverview extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
onPressed: () {
|
||||
if (supportsInAppPurchase() &&
|
||||
!account.hasIapPlan &&
|
||||
account.paymentId.isEmpty) {
|
||||
if (supportsInAppPurchase() && account.canMakeIAP) {
|
||||
showDialog<void>(
|
||||
context: context,
|
||||
builder: (context) => UpgradeDialog(),
|
||||
|
|
|
|||
Loading…
Reference in New Issue