Skip to content

Commit

Permalink
Fix posible problem clearTransactionsIOS promise (#1227)
Browse files Browse the repository at this point in the history
Solution recommended by rusty120 to avoid a possible deadlock in the promise of the clearTransactionsIOS

hyochan/react-native-iap#1120 (comment)
  • Loading branch information
dev-arrow committed May 31, 2023
1 parent a88db72 commit 9374fdd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ios/RNIapIos.m
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ - (void)requestDidFinish:(SKRequest *)request {
-(void)paymentQueue:(SKPaymentQueue *)queue removedTransactions:(NSArray *)transactions {
NSLog(@"removedTransactions");
if (countPendingTransaction != nil && countPendingTransaction > 0) {
countPendingTransaction--;
countPendingTransaction -= [transactions count];
if (countPendingTransaction == 0) {
[self resolvePromisesForKey:@"cleaningTransactions" value:nil];
countPendingTransaction = nil;
Expand Down

0 comments on commit 9374fdd

Please sign in to comment.