Skip to content

Commit

Permalink
Merge pull request #228 from 0x1-company/fix-membership
Browse files Browse the repository at this point in the history
fix: 🐛 purchase error handle
  • Loading branch information
tomokisun authored Jan 24, 2024
2 parents b649810 + 2b08369 commit ccbd557
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Packages/BeMatch/Sources/MembershipFeature/Membership.swift
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,16 @@ public struct MembershipLogic {
guard data.createAppleSubscription else { return }
await send(.transactionFinish(transaction))
} catch: { error, send in
async let finish: Void = send(.transactionFinish(transaction))
async let failure: Void = send(.createAppleSubscriptionResponse(.failure(error)))
_ = await (finish, failure)
await send(.createAppleSubscriptionResponse(.failure(error)))
}

case .purchaseResponse(.failure):
state.isActivityIndicatorVisible = false
return .none

case .createAppleSubscriptionResponse(.failure):
state.isActivityIndicatorVisible = false
return .none

case let .onCompletion(completion):
state.isPresented = false
Expand Down

0 comments on commit ccbd557

Please sign in to comment.