Fix timeline reducer fix #2266

This commit is contained in:
Thomas Ricouard 2025-04-10 08:40:08 +02:00
parent 6e4d4b5b8c
commit 8e7604e931
2 changed files with 7 additions and 1 deletions

View file

@ -38,6 +38,10 @@ public enum TimelineFilter: Hashable, Equatable, Identifiable, Sendable {
case link(url: URL, title: String)
case latest
case resume
public static func == (lhs: TimelineFilter, rhs: TimelineFilter) -> Bool {
lhs.id == rhs.id
}
public var id: String {
switch self {

View file

@ -113,6 +113,7 @@ public struct TimelineView: View {
}
}
.onChange(of: timeline) { oldValue, newValue in
guard oldValue != newValue else { return }
switch newValue {
case let .remoteLocal(server, _):
viewModel.client = Client(server: server)
@ -130,7 +131,8 @@ public struct TimelineView: View {
}
viewModel.timeline = newValue
}
.onChange(of: viewModel.timeline) { _, newValue in
.onChange(of: viewModel.timeline) { oldValue, newValue in
guard oldValue != newValue, timeline != newValue else { return }
timeline = newValue
}
.onChange(of: contentFilter.showReplies) { _, _ in