This commit is contained in:
Thomas Ricouard 2024-09-25 12:49:54 +02:00
parent 70eb781407
commit 9fbd0a6a2f
2 changed files with 6 additions and 8 deletions

View file

@ -60,13 +60,13 @@ struct TimelineTab: View {
timeline = .trending timeline = .trending
} }
} }
Task {
await currentAccount.fetchLists()
}
if !client.isAuth { if !client.isAuth {
routerPath.presentedSheet = .addAccount routerPath.presentedSheet = .addAccount
} }
} }
.task {
await currentAccount.fetchLists()
}
.onChange(of: client.isAuth) { .onChange(of: client.isAuth) {
resetTimelineFilter() resetTimelineFilter()
} }

View file

@ -106,7 +106,7 @@ public struct NotificationsListView: View {
.scrollContentBackground(.hidden) .scrollContentBackground(.hidden)
.background(theme.primaryBackgroundColor) .background(theme.primaryBackgroundColor)
#endif #endif
.onAppear { .task {
viewModel.client = client viewModel.client = client
viewModel.currentAccount = account viewModel.currentAccount = account
if let lockedType { if let lockedType {
@ -117,10 +117,8 @@ public struct NotificationsListView: View {
} else { } else {
viewModel.loadSelectedType() viewModel.loadSelectedType()
} }
Task { await viewModel.fetchNotifications(viewModel.selectedType)
await viewModel.fetchNotifications(viewModel.selectedType) await viewModel.fetchPolicy()
await viewModel.fetchPolicy()
}
} }
.refreshable { .refreshable {
SoundEffectManager.shared.playSound(.pull) SoundEffectManager.shared.playSound(.pull)