mirror of
https://github.com/bitwarden/browser.git
synced 2025-03-09 12:59:20 +01:00
makingPremiumAfterPurchase check
This commit is contained in:
parent
e52f593d8b
commit
9c7a5b3c1a
2
jslib
2
jslib
@ -1 +1 @@
|
|||||||
Subproject commit 034aefa652459c9ed5a660fe13593e314ee368dc
|
Subproject commit e16cb9b801bec1cf1744d8b48f39421ad37e1644
|
@ -34,6 +34,8 @@ export class PremiumComponent extends BasePremiumComponent {
|
|||||||
appStoreFormattedPrice = '$14.99';
|
appStoreFormattedPrice = '$14.99';
|
||||||
canRestorePurchase = false;
|
canRestorePurchase = false;
|
||||||
|
|
||||||
|
private makingPremiumAfterPurchase = false;
|
||||||
|
|
||||||
constructor(i18nService: I18nService, platformUtilsService: PlatformUtilsService,
|
constructor(i18nService: I18nService, platformUtilsService: PlatformUtilsService,
|
||||||
tokenService: TokenService, apiService: ApiService,
|
tokenService: TokenService, apiService: ApiService,
|
||||||
private ngZone: NgZone, private messagingService: MessagingService,
|
private ngZone: NgZone, private messagingService: MessagingService,
|
||||||
@ -78,10 +80,14 @@ export class PremiumComponent extends BasePremiumComponent {
|
|||||||
case 'purchased':
|
case 'purchased':
|
||||||
// tslint:disable-next-line
|
// tslint:disable-next-line
|
||||||
console.log(`${payment.productIdentifier} purchased.`);
|
console.log(`${payment.productIdentifier} purchased.`);
|
||||||
if (payment.productIdentifier !== AppStorePremiumPlan) {
|
if (this.makingPremiumAfterPurchase || payment.productIdentifier !== AppStorePremiumPlan) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
this.makingPremiumAfterPurchase = true;
|
||||||
await this.makePremium(false);
|
await this.makePremium(false);
|
||||||
|
} catch { }
|
||||||
|
this.makingPremiumAfterPurchase = false;
|
||||||
// Finish the transaction.
|
// Finish the transaction.
|
||||||
remote.inAppPurchase.finishTransactionByDate(transaction.transactionDate);
|
remote.inAppPurchase.finishTransactionByDate(transaction.transactionDate);
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user