summaryrefslogtreecommitdiff
path: root/Sora/Views
diff options
context:
space:
mode:
Diffstat (limited to 'Sora/Views')
-rw-r--r--Sora/Views/Post/Grid/PostGridView.swift17
1 files changed, 2 insertions, 15 deletions
diff --git a/Sora/Views/Post/Grid/PostGridView.swift b/Sora/Views/Post/Grid/PostGridView.swift
index 0125b60..5d08d2c 100644
--- a/Sora/Views/Post/Grid/PostGridView.swift
+++ b/Sora/Views/Post/Grid/PostGridView.swift
@@ -17,7 +17,7 @@ struct PostGridView: View {
}
var body: some View {
- ScrollViewReader { proxy in
+ ScrollViewReader { _ in
ZStack {
ForEach(Array(manager.searchHistory.enumerated()), id: \.element.id) { index, query in
let isActive = index == manager.historyIndex
@@ -37,16 +37,6 @@ struct PostGridView: View {
}
.gridStyle(columns: settings.thumbnailGridColumns)
.padding(8)
- .onAppear {
- if isActive, let scrollPosition = viewStates[query.id]?.scrollPosition {
- proxy.scrollTo(scrollPosition)
- }
- }
- .onChange(of: filteredPosts.first?.id) { _, newID in
- if isActive, let newID {
- updateViewState(for: query.id, scrollPosition: newID)
- }
- }
}
.opacity(isActive ? 1 : 0)
.frame(height: isActive ? nil : 0)
@@ -210,8 +200,7 @@ struct PostGridView: View {
private func updateViewState(
for queryID: UUID,
posts: [BooruPost] = [],
- currentPage: Int? = nil,
- scrollPosition: String? = nil
+ currentPage: Int? = nil
) {
var state = viewStates[queryID] ?? PostGridViewState()
@@ -219,8 +208,6 @@ struct PostGridView: View {
if let currentPage { state.currentPage = currentPage }
- if let scrollPosition { state.scrollPosition = scrollPosition }
-
viewStates[queryID] = state
}
}