diff --git a/IceCubesApp/App/Tabs/Timeline/TimelineTab.swift b/IceCubesApp/App/Tabs/Timeline/TimelineTab.swift index 6cc8a800..51e04944 100644 --- a/IceCubesApp/App/Tabs/Timeline/TimelineTab.swift +++ b/IceCubesApp/App/Tabs/Timeline/TimelineTab.swift @@ -60,13 +60,13 @@ struct TimelineTab: View { timeline = .trending } } - Task { - await currentAccount.fetchLists() - } if !client.isAuth { routerPath.presentedSheet = .addAccount } } + .task { + await currentAccount.fetchLists() + } .onChange(of: client.isAuth) { resetTimelineFilter() } diff --git a/Packages/Notifications/Sources/Notifications/NotificationsListView.swift b/Packages/Notifications/Sources/Notifications/NotificationsListView.swift index 6a1c75a4..9aed8834 100644 --- a/Packages/Notifications/Sources/Notifications/NotificationsListView.swift +++ b/Packages/Notifications/Sources/Notifications/NotificationsListView.swift @@ -106,7 +106,7 @@ public struct NotificationsListView: View { .scrollContentBackground(.hidden) .background(theme.primaryBackgroundColor) #endif - .onAppear { + .task { viewModel.client = client viewModel.currentAccount = account if let lockedType { @@ -117,10 +117,8 @@ public struct NotificationsListView: View { } else { viewModel.loadSelectedType() } - Task { - await viewModel.fetchNotifications(viewModel.selectedType) - await viewModel.fetchPolicy() - } + await viewModel.fetchNotifications(viewModel.selectedType) + await viewModel.fetchPolicy() } .refreshable { SoundEffectManager.shared.playSound(.pull)