We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello, I think I might have found a bug in the subscription check and assignment logic.
Here's what I found: The code will resolve to .success but set passStatus = .notSubscribed. That added debug print statement demonstrates that.
Sample Code:
.subscriptionStatusTask(for: passIDs.group) { taskStatus in self.status = await taskStatus.map { statuses in await ProductSubscription.shared.status( for: statuses, ids: passIDs ) } switch self.status { case .failure(let error): passStatusModel.passStatus = .notSubscribed case .success(let status): passStatusModel.passStatus = status print("Status from subscriptionStatusTask = .success | passStatus actually set to \(passStatusModel.passStatus)") case .loading: break @unknown default } }
In my case I'm relying on these results to show/dismiss the subscription sheet -- so I modified Code as follows to correct this behavior:
switch self.status { case .failure(let error): passStatusModel.passStatus = .notSubscribed showSubscriptionView = true case .success(let status): passStatusModel.passStatus = status if passStatusModel.passStatus == .notSubscribed { showSubscriptionView = true } else { showSubscriptionView = false } case .loading: break @unknown default: break } }
Thoughts?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello, I think I might have found a bug in the subscription check and assignment logic.
Here's what I found: The code will resolve to .success but set passStatus = .notSubscribed. That added debug print statement demonstrates that.
Sample Code:
In my case I'm relying on these results to show/dismiss the subscription sheet -- so I modified Code as follows to correct this behavior:
Thoughts?
The text was updated successfully, but these errors were encountered: