From f6ff3bc7243f72a49ee859f94bb39ac7b93d3f80 Mon Sep 17 00:00:00 2001 From: William Brawner Date: Tue, 3 Jan 2023 21:20:38 -0700 Subject: [PATCH] Fix macOS builds --- Twigs/Budget/BudgetDetailsView.swift | 2 ++ Twigs/Category/CategoryListView.swift | 5 ++++- .../RecurringTransactionsListView.swift | 2 ++ Twigs/Transaction/TransactionListView.swift | 2 ++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Twigs/Budget/BudgetDetailsView.swift b/Twigs/Budget/BudgetDetailsView.swift index c3b3fc1..1d78e8d 100644 --- a/Twigs/Budget/BudgetDetailsView.swift +++ b/Twigs/Budget/BudgetDetailsView.swift @@ -32,9 +32,11 @@ struct BudgetDetailsView: View { } } .listStyle(.insetGrouped) + #if !targetEnvironment(macCatalyst) .refreshable { await dataStore.loadOverview(showLoader: false) } + #endif .navigationBarItems(trailing: Button(action: { dataStore.editBudget() }, label: { Text("edit") })) diff --git a/Twigs/Category/CategoryListView.swift b/Twigs/Category/CategoryListView.swift index fb12d52..ebcedc9 100644 --- a/Twigs/Category/CategoryListView.swift +++ b/Twigs/Category/CategoryListView.swift @@ -48,9 +48,12 @@ struct CategoryListView: View { } } } - }.refreshable { + } + #if !targetEnvironment(macCatalyst) + .refreshable { await dataStore.getCategories() } + #endif .navigationBarItems(trailing: Button(action: { Task { await dataStore.edit(TwigsCore.Category(budgetId: budgetId)) diff --git a/Twigs/Recurring Transactions/RecurringTransactionsListView.swift b/Twigs/Recurring Transactions/RecurringTransactionsListView.swift index aebc915..8fe7258 100644 --- a/Twigs/Recurring Transactions/RecurringTransactionsListView.swift +++ b/Twigs/Recurring Transactions/RecurringTransactionsListView.swift @@ -32,9 +32,11 @@ struct RecurringTransactionsListView: View { } } } + #if !targetEnvironment(macCatalyst) .refreshable { await dataStore.getRecurringTransactions(showLoader: false) } + #endif } .toolbar { ToolbarItem(placement: .navigationBarTrailing) { diff --git a/Twigs/Transaction/TransactionListView.swift b/Twigs/Transaction/TransactionListView.swift index d88824d..7c6cad5 100644 --- a/Twigs/Transaction/TransactionListView.swift +++ b/Twigs/Transaction/TransactionListView.swift @@ -95,9 +95,11 @@ struct TransactionListView: View where Content: View { TransactionList(transactions) } .searchable(text: $search) + #if !targetEnvironment(macCatalyst) .refreshable { await dataStore.getTransactions(showLoader: false) } + #endif .sheet( isPresented: .constant(addingTransaction), content: {