Fixed PurchasesOrchestrator compilation error on Xcode 14.3 beta 1#2292
Merged
NachoSoto merged 1 commit intoFeb 17, 2023
Merged
Conversation
Fixes #2291. This has led to issues in the past too (#1994, #2221, RevenueCat/purchases-flutter#516, RevenueCat/purchases-flutter#507) because I tried to reuse that code to call a single completion method. The new version of Swift makes that impossible now, because it detects that `@MainActor` isn't available in iOS 12. To finally work around all those issues, this simply duplicates this single line of code, which should work across all versions of Swift.
aboedo
approved these changes
Feb 17, 2023
Comment on lines
960
to
+965
| if finishable { | ||
| self.finishTransactionIfNeeded(transaction) { complete() } | ||
| self.finishTransactionIfNeeded(transaction) { | ||
| completion?(transaction, nil, purchasesError, false) | ||
| } | ||
| } else { | ||
| complete() | ||
| completion?(transaction, nil, purchasesError, false) |
Member
There was a problem hiding this comment.
honestly this is easier to read too
Contributor
Author
There was a problem hiding this comment.
Yeah totally 🤷🏻♂️ not sure why I didn't realize it earlier that we could go back to this.
tonidero
approved these changes
Feb 17, 2023
NachoSoto
added a commit
that referenced
this pull request
Feb 21, 2023
This was referenced Feb 21, 2023
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2291.
This has led to issues in the past too (#1994, #2221, RevenueCat/purchases-flutter#516, RevenueCat/purchases-flutter#507) because I tried to reuse that code to call a single completion method.
The new version of Swift makes that impossible now, because it detects that
@MainActorisn't available in iOS 12.To finally work around all those issues, this simply duplicates this single line of code, which should work across all versions of Swift.