From 75cd23df5de4a2ef5a088b6703f25db710f0249b Mon Sep 17 00:00:00 2001 From: Thomas Ricouard Date: Sat, 7 Jan 2023 14:06:40 +0100 Subject: [PATCH] Better purchase flow --- IceCubesApp/App/Tabs/Settings/SupportAppView.swift | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/IceCubesApp/App/Tabs/Settings/SupportAppView.swift b/IceCubesApp/App/Tabs/Settings/SupportAppView.swift index 9ef958f6..3c4b16d3 100644 --- a/IceCubesApp/App/Tabs/Settings/SupportAppView.swift +++ b/IceCubesApp/App/Tabs/Settings/SupportAppView.swift @@ -82,10 +82,11 @@ struct SupportAppView: View { Spacer() Button { isProcessingPurchase = true - Purchases.shared.purchase(product: product) { _, _, _, success in - if success { + Task { + do { + _ = try await Purchases.shared.purchase(product: product) purchaseSuccessDisplayed = true - } else { + } catch { purchaseErrorDisplayed = true } isProcessingPurchase = false