diff --git a/jslib b/jslib index 034aefa652..e16cb9b801 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 034aefa652459c9ed5a660fe13593e314ee368dc +Subproject commit e16cb9b801bec1cf1744d8b48f39421ad37e1644 diff --git a/src/app/accounts/premium.component.ts b/src/app/accounts/premium.component.ts index 9b9ee0415b..58ef743a92 100644 --- a/src/app/accounts/premium.component.ts +++ b/src/app/accounts/premium.component.ts @@ -34,6 +34,8 @@ export class PremiumComponent extends BasePremiumComponent { appStoreFormattedPrice = '$14.99'; canRestorePurchase = false; + private makingPremiumAfterPurchase = false; + constructor(i18nService: I18nService, platformUtilsService: PlatformUtilsService, tokenService: TokenService, apiService: ApiService, private ngZone: NgZone, private messagingService: MessagingService, @@ -78,10 +80,14 @@ export class PremiumComponent extends BasePremiumComponent { case 'purchased': // tslint:disable-next-line console.log(`${payment.productIdentifier} purchased.`); - if (payment.productIdentifier !== AppStorePremiumPlan) { + if (this.makingPremiumAfterPurchase || payment.productIdentifier !== AppStorePremiumPlan) { return; } - await this.makePremium(false); + try { + this.makingPremiumAfterPurchase = true; + await this.makePremium(false); + } catch { } + this.makingPremiumAfterPurchase = false; // Finish the transaction. remote.inAppPurchase.finishTransactionByDate(transaction.transactionDate); break;