diff --git a/Twigs/DataStore.swift b/Twigs/DataStore.swift index 6e09051..490b7a7 100644 --- a/Twigs/DataStore.swift +++ b/Twigs/DataStore.swift @@ -436,6 +436,7 @@ class DataStore : ObservableObject { do { let user = try await self.apiService.getUser(userId) self.currentUser = .success(user) + await getBudgets() } catch { self.currentUser = .error(error) } diff --git a/Twigs/TabbedBudgetView.swift b/Twigs/TabbedBudgetView.swift index 38e5c00..516e0a8 100644 --- a/Twigs/TabbedBudgetView.swift +++ b/Twigs/TabbedBudgetView.swift @@ -73,26 +73,19 @@ struct TabbedBudgetView: View { var body: some View { mainView.sheet(isPresented: $dataStore.showLogin, - onDismiss: { - Task { - await self.dataStore.getBudgets() - } - }, content: { LoginView() .environmentObject(dataStore) - .onDisappear { - Task { - await self.dataStore.getBudgets() - } - } - }).sheet(isPresented: $dataStore.showBudgetSelection, + .interactiveDismissDisabled(true) + }) + + .sheet(isPresented: $dataStore.showBudgetSelection, content: { List { BudgetListsView().environmentObject(dataStore) } - }) .interactiveDismissDisabled(true) + }) } }