mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-12-18 21:26:39 +00:00
Don't allow multiple tap on purchase button Close #393
This commit is contained in:
parent
8a40799a3d
commit
c25f94eed1
1 changed files with 12 additions and 8 deletions
|
@ -97,15 +97,19 @@ struct SupportAppView: View {
|
||||||
}
|
}
|
||||||
Spacer()
|
Spacer()
|
||||||
Button {
|
Button {
|
||||||
isProcessingPurchase = true
|
if !isProcessingPurchase {
|
||||||
Task {
|
isProcessingPurchase = true
|
||||||
do {
|
Task {
|
||||||
_ = try await Purchases.shared.purchase(product: product)
|
do {
|
||||||
purchaseSuccessDisplayed = true
|
let result = try await Purchases.shared.purchase(product: product)
|
||||||
} catch {
|
if !result.userCancelled {
|
||||||
purchaseErrorDisplayed = true
|
purchaseSuccessDisplayed = true
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
purchaseErrorDisplayed = true
|
||||||
|
}
|
||||||
|
isProcessingPurchase = false
|
||||||
}
|
}
|
||||||
isProcessingPurchase = false
|
|
||||||
}
|
}
|
||||||
} label: {
|
} label: {
|
||||||
if isProcessingPurchase {
|
if isProcessingPurchase {
|
||||||
|
|
Loading…
Reference in a new issue