Fix timeline filter update
This commit is contained in:
parent
3743e6d870
commit
e2f0863ff6
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue