mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-12-25 14:32:20 +01:00
Don't allow multiple tap on purchase button Close #393
This commit is contained in:
parent
8a40799a3d
commit
c25f94eed1
@ -97,15 +97,19 @@ struct SupportAppView: View {
|
||||
}
|
||||
Spacer()
|
||||
Button {
|
||||
isProcessingPurchase = true
|
||||
Task {
|
||||
do {
|
||||
_ = try await Purchases.shared.purchase(product: product)
|
||||
purchaseSuccessDisplayed = true
|
||||
} catch {
|
||||
purchaseErrorDisplayed = true
|
||||
if !isProcessingPurchase {
|
||||
isProcessingPurchase = true
|
||||
Task {
|
||||
do {
|
||||
let result = try await Purchases.shared.purchase(product: product)
|
||||
if !result.userCancelled {
|
||||
purchaseSuccessDisplayed = true
|
||||
}
|
||||
} catch {
|
||||
purchaseErrorDisplayed = true
|
||||
}
|
||||
isProcessingPurchase = false
|
||||
}
|
||||
isProcessingPurchase = false
|
||||
}
|
||||
} label: {
|
||||
if isProcessingPurchase {
|
||||
|
Loading…
Reference in New Issue
Block a user