Fix timeline filter update

This commit is contained in:
Thomas Ricouard 2023-09-19 18:33:13 +02:00
parent 3743e6d870
commit e2f0863ff6
1 changed files with 10 additions and 10 deletions

View File

@ -60,18 +60,10 @@ struct TimelineTab: View {
}
}
.onChange(of: client.isAuth) {
if client.isAuth {
timeline = lastTimelineFilter
} else {
timeline = .federated
}
resetTimelineFilter()
}
.onChange(of: currentAccount.account?.id) {
if client.isAuth, canFilterTimeline {
timeline = lastTimelineFilter
} else {
timeline = .federated
}
resetTimelineFilter()
}
.onChange(of: $popToRootTab.wrappedValue) { _, newValue in
if newValue == .timeline {
@ -235,4 +227,12 @@ struct TimelineTab: View {
}
}
}
private func resetTimelineFilter() {
if client.isAuth, canFilterTimeline {
timeline = lastTimelineFilter
} else {
timeline = .federated
}
}
}