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
}
}
Task {
await currentAccount.fetchLists()
}
if !client.isAuth {
routerPath.presentedSheet = .addAccount
}
}
.task {
await currentAccount.fetchLists()
}
.onChange(of: client.isAuth) {
resetTimelineFilter()
}

View file

@ -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,11 +117,9 @@ public struct NotificationsListView: View {
} else {
viewModel.loadSelectedType()
}
Task {
await viewModel.fetchNotifications(viewModel.selectedType)
await viewModel.fetchPolicy()
}
}
.refreshable {
SoundEffectManager.shared.playSound(.pull)
HapticManager.shared.fireHaptic(.dataRefresh(intensity: 0.3))