diff options
| author | Fuwn <[email protected]> | 2025-02-28 03:46:41 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-02-28 03:46:41 -0800 |
| commit | 93fd5a0f53ab9dc30a04f758e17b5c7363f531fe (patch) | |
| tree | 0a164c694668c26964332785295ab6e219e374e4 /Sora/Views/Post | |
| parent | feat: Development commit (diff) | |
| download | sora-testing-93fd5a0f53ab9dc30a04f758e17b5c7363f531fe.tar.xz sora-testing-93fd5a0f53ab9dc30a04f758e17b5c7363f531fe.zip | |
feat: Development commit
Diffstat (limited to 'Sora/Views/Post')
| -rw-r--r-- | Sora/Views/Post/Grid/PostGridSearchHistoryView.swift | 8 | ||||
| -rw-r--r-- | Sora/Views/Post/Grid/PostGridView.swift | 6 |
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) } } |