diff options
| author | Fuwn <[email protected]> | 2025-03-23 06:07:53 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-03-23 06:07:53 -0700 |
| commit | 2f57244b88b0964ecdca5b7ef86b03b2ec277fd9 (patch) | |
| tree | 3f0c0bbbfe8197358c6d7063027bfd164435496e /Sora/Views/Post/Grid/PostGridView.swift | |
| parent | feat: Development commit (diff) | |
| download | sora-testing-2f57244b88b0964ecdca5b7ef86b03b2ec277fd9.tar.xz sora-testing-2f57244b88b0964ecdca5b7ef86b03b2ec277fd9.zip | |
feat: Development commit
Diffstat (limited to 'Sora/Views/Post/Grid/PostGridView.swift')
| -rw-r--r-- | Sora/Views/Post/Grid/PostGridView.swift | 17 |
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 } } |