Fix #1905
This commit is contained in:
parent
f79117eff1
commit
ebdd5b9feb
|
@ -40,7 +40,13 @@ public enum TimelineFilter: Hashable, Equatable, Identifiable {
|
||||||
case resume
|
case resume
|
||||||
|
|
||||||
public var id: String {
|
public var id: String {
|
||||||
title
|
switch self {
|
||||||
|
case let .remoteLocal(server, filter):
|
||||||
|
return server + filter.rawValue
|
||||||
|
default:
|
||||||
|
return title
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public func hash(into hasher: inout Hasher) {
|
public func hash(into hasher: inout Hasher) {
|
||||||
|
|
|
@ -154,13 +154,18 @@ public struct TimelineView: View {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.onChange(of: timeline) { _, newValue in
|
.onChange(of: timeline) { oldValue, newValue in
|
||||||
switch newValue {
|
switch newValue {
|
||||||
|
case let .remoteLocal(server, _):
|
||||||
|
viewModel.client = Client(server: server)
|
||||||
|
default:
|
||||||
|
switch oldValue {
|
||||||
case let .remoteLocal(server, _):
|
case let .remoteLocal(server, _):
|
||||||
viewModel.client = Client(server: server)
|
viewModel.client = Client(server: server)
|
||||||
default:
|
default:
|
||||||
viewModel.client = client
|
viewModel.client = client
|
||||||
}
|
}
|
||||||
|
}
|
||||||
viewModel.timeline = newValue
|
viewModel.timeline = newValue
|
||||||
}
|
}
|
||||||
.onChange(of: viewModel.timeline) { _, newValue in
|
.onChange(of: viewModel.timeline) { _, newValue in
|
||||||
|
|
Loading…
Reference in New Issue