From 1035bacc5829d68ec68f0ec7ebdcce6e47dfaa19 Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Fri, 3 Jul 2020 22:32:34 +0200 Subject: [PATCH] SubscriptionStatus: Avoid rechecking on start Just check once and cache the value. --- lib/iap.dart | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/iap.dart b/lib/iap.dart index 22bfe73d..3ee5e328 100644 --- a/lib/iap.dart +++ b/lib/iap.dart @@ -14,6 +14,10 @@ class InAppPurchases { Log.i("Not checking PurchaseInfo as exp = $exp and cur = $currentDt"); return; } + if (exp == "-") { + Log.d("Ignoring IAP pro check - already checked"); + return; + } if (JournalApp.isInDebugMode) { Log.d("Ignoring IAP pro check - debug mode"); @@ -29,7 +33,8 @@ class InAppPurchases { Settings.instance.proMode = isPro; Settings.instance.save(); } else { - Settings.instance.proExpirationDate = sub.expiryDate.toIso8601String(); + Settings.instance.proExpirationDate = + sub != null ? sub.expiryDate.toIso8601String() : "-"; Settings.instance.save(); } }