SubscriptionStatus: Avoid rechecking on start

Just check once and cache the value.
This commit is contained in:
Vishesh Handa
2020-07-03 22:32:34 +02:00
parent cc7d6e7e61
commit 1035bacc58

View File

@ -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();
}
}