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