mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-12-23 13:28:50 +01:00
Fixed scroll to top
This commit is contained in:
parent
224b1b0693
commit
a06386c1da
@ -34,10 +34,10 @@ public struct TimelineView: View {
|
|||||||
ScrollViewReader { proxy in
|
ScrollViewReader { proxy in
|
||||||
ZStack(alignment: .top) {
|
ZStack(alignment: .top) {
|
||||||
ScrollView {
|
ScrollView {
|
||||||
LazyVStack {
|
|
||||||
Rectangle()
|
Rectangle()
|
||||||
.frame(height: 0)
|
.frame(height: 0)
|
||||||
.id(Constants.scrollToTop)
|
.id(Constants.scrollToTop)
|
||||||
|
LazyVStack {
|
||||||
tagHeaderView
|
tagHeaderView
|
||||||
.padding(.bottom, 16)
|
.padding(.bottom, 16)
|
||||||
StatusesListView(fetcher: viewModel)
|
StatusesListView(fetcher: viewModel)
|
||||||
@ -93,8 +93,8 @@ public struct TimelineView: View {
|
|||||||
private func makePendingNewPostsView(proxy: ScrollViewProxy) -> some View {
|
private func makePendingNewPostsView(proxy: ScrollViewProxy) -> some View {
|
||||||
if !viewModel.pendingStatuses.isEmpty {
|
if !viewModel.pendingStatuses.isEmpty {
|
||||||
Button {
|
Button {
|
||||||
proxy.scrollTo(Constants.scrollToTop)
|
|
||||||
withAnimation {
|
withAnimation {
|
||||||
|
proxy.scrollTo(Constants.scrollToTop)
|
||||||
viewModel.displayPendingStatuses()
|
viewModel.displayPendingStatuses()
|
||||||
}
|
}
|
||||||
} label: {
|
} label: {
|
||||||
|
Loading…
Reference in New Issue
Block a user