mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2025-04-15 13:04:06 +00:00
Fix timeline reducer fix #2266
This commit is contained in:
parent
6e4d4b5b8c
commit
8e7604e931
2 changed files with 7 additions and 1 deletions
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue