summaryrefslogtreecommitdiff
path: root/Sora/Views/Post/Grid
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-02-28 03:46:41 -0800
committerFuwn <[email protected]>2025-02-28 03:46:41 -0800
commit93fd5a0f53ab9dc30a04f758e17b5c7363f531fe (patch)
tree0a164c694668c26964332785295ab6e219e374e4 /Sora/Views/Post/Grid
parentfeat: Development commit (diff)
downloadsora-testing-93fd5a0f53ab9dc30a04f758e17b5c7363f531fe.tar.xz
sora-testing-93fd5a0f53ab9dc30a04f758e17b5c7363f531fe.zip
feat: Development commit
Diffstat (limited to 'Sora/Views/Post/Grid')
-rw-r--r--Sora/Views/Post/Grid/PostGridSearchHistoryView.swift8
-rw-r--r--Sora/Views/Post/Grid/PostGridView.swift6
2 files changed, 12 insertions, 2 deletions
diff --git a/Sora/Views/Post/Grid/PostGridSearchHistoryView.swift b/Sora/Views/Post/Grid/PostGridSearchHistoryView.swift
index 2f95118..2816d35 100644
--- a/Sora/Views/Post/Grid/PostGridSearchHistoryView.swift
+++ b/Sora/Views/Post/Grid/PostGridSearchHistoryView.swift
@@ -5,6 +5,7 @@ struct PostGridSearchHistoryView: View {
@EnvironmentObject private var settings: SettingsManager
@State private var searchText: String = ""
@Binding var selectedTab: Int
+ @Binding var isPresented: Bool
var filteredHistory: [BooruSearchQuery] {
guard !searchText.isEmpty else {
@@ -43,6 +44,8 @@ struct PostGridSearchHistoryView: View {
manager.searchText = query.tags.joined(separator: " ")
selectedTab = 0
+ isPresented.toggle()
+
if previousProvider == settings.preferredBooru {
manager.performSearch()
}
@@ -70,7 +73,10 @@ struct PostGridSearchHistoryView: View {
}
#Preview {
- PostGridSearchHistoryView(selectedTab: .constant(0))
+ PostGridSearchHistoryView(
+ selectedTab: .constant(0),
+ isPresented: .constant(true)
+ )
.environmentObject(SettingsManager())
.environmentObject(BooruManager(.safebooru))
}
diff --git a/Sora/Views/Post/Grid/PostGridView.swift b/Sora/Views/Post/Grid/PostGridView.swift
index 76bfa7c..b54863f 100644
--- a/Sora/Views/Post/Grid/PostGridView.swift
+++ b/Sora/Views/Post/Grid/PostGridView.swift
@@ -5,6 +5,7 @@ struct PostGridView: View {
@EnvironmentObject var settings: SettingsManager
@EnvironmentObject var manager: BooruManager
@State private var isSearchHistoryPresented = false
+ @Binding var selectedTab: Int
@Environment(\.isSearching)
private var isSearching
@@ -112,7 +113,10 @@ struct PostGridView: View {
}
.scrollDisabled(manager.isLoading)
.sheet(isPresented: $isSearchHistoryPresented) {
- PostGridSearchHistoryView(selectedTab: .constant(0))
+ PostGridSearchHistoryView(
+ selectedTab: $selectedTab,
+ isPresented: $isSearchHistoryPresented
+ )
.frame(minHeight: 250)
}
}