mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-12-27 09:30:37 +00:00
Mitigate #623
This commit is contained in:
parent
cba9378a5f
commit
eb80225bb0
1 changed files with 8 additions and 2 deletions
|
@ -21,6 +21,7 @@ public struct TimelineView: View {
|
|||
@StateObject private var viewModel = TimelineViewModel()
|
||||
|
||||
@State private var wasBackgrounded: Bool = false
|
||||
@State private var listOpacity: CGFloat = 1
|
||||
|
||||
@Binding var timeline: TimelineFilter
|
||||
@Binding var scrollToTopSignal: Int
|
||||
|
@ -46,7 +47,8 @@ public struct TimelineView: View {
|
|||
StatusesListView(fetcher: viewModel)
|
||||
}
|
||||
}
|
||||
.id(client.id)
|
||||
.id(client.id + (viewModel.scrollToStatus ?? ""))
|
||||
.opacity(listOpacity)
|
||||
.environment(\.defaultMinListRowHeight, 1)
|
||||
.listStyle(.plain)
|
||||
.scrollContentBackground(.hidden)
|
||||
|
@ -58,7 +60,11 @@ public struct TimelineView: View {
|
|||
.onChange(of: viewModel.scrollToStatus) { statusId in
|
||||
if let statusId {
|
||||
viewModel.scrollToStatus = nil
|
||||
proxy.scrollTo(statusId, anchor: .center)
|
||||
listOpacity = 0
|
||||
DispatchQueue.main.async {
|
||||
proxy.scrollTo(statusId, anchor: .top)
|
||||
listOpacity = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
.onChange(of: scrollToTopSignal, perform: { _ in
|
||||
|
|
Loading…
Reference in a new issue