File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed
WooCommerce/Classes/ViewRelated/InAppPurchases Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,9 @@ struct InAppPurchasesDebugView: View {
1313 List {
1414 Section {
1515 Button ( " Reload products " ) {
16- loadProducts ( )
16+ Task {
17+ await loadProducts ( )
18+ }
1719 }
1820 }
1921 Section ( " Products " ) {
@@ -37,19 +39,17 @@ struct InAppPurchasesDebugView: View {
3739 }
3840 }
3941 . navigationTitle ( " IAP Debug " )
40- . onAppear {
41- loadProducts ( )
42+ . task {
43+ await loadProducts ( )
4244 }
4345 }
4446
45- private func loadProducts( ) {
46- Task {
47- do {
48- self . products = try await inAppPurchasesForWPComPlansManager. fetchProducts ( )
49- await loadUserEntitlements ( )
50- } catch {
51- print ( " Error loading products: \( error) " )
52- }
47+ private func loadProducts( ) async {
48+ do {
49+ self . products = try await inAppPurchasesForWPComPlansManager. fetchProducts ( )
50+ await loadUserEntitlements ( )
51+ } catch {
52+ print ( " Error loading products: \( error) " )
5353 }
5454 }
5555
You can’t perform that action at this time.
0 commit comments