summaryrefslogtreecommitdiff
path: root/Sora
diff options
context:
space:
mode:
Diffstat (limited to 'Sora')
-rw-r--r--Sora/Views/Bookmarks/BookmarksView.swift1
-rw-r--r--Sora/Views/Generic/GenericListView.swift13
-rw-r--r--Sora/Views/Post/Grid/PostGridSearchHistoryView.swift1
3 files changed, 9 insertions, 6 deletions
diff --git a/Sora/Views/Bookmarks/BookmarksView.swift b/Sora/Views/Bookmarks/BookmarksView.swift
index fa7734e..babc667 100644
--- a/Sora/Views/Bookmarks/BookmarksView.swift
+++ b/Sora/Views/Bookmarks/BookmarksView.swift
@@ -8,6 +8,7 @@ struct BookmarksView: View {
GenericListView(
selectedTab: $selectedTab,
isPresented: .constant(false),
+ allowBookmarking: false,
title: "Bookmarks",
emptyMessage: "No Bookmarks",
emptyIcon: "bookmark",
diff --git a/Sora/Views/Generic/GenericListView.swift b/Sora/Views/Generic/GenericListView.swift
index f9c63a8..acc8a6e 100644
--- a/Sora/Views/Generic/GenericListView.swift
+++ b/Sora/Views/Generic/GenericListView.swift
@@ -7,7 +7,7 @@ struct GenericListView<T: Identifiable & Hashable & GenericItem>: View {
@State private var searchText: String = ""
@State private var isShowingRemoveAllConfirmation = false
@Binding var isPresented: Bool
-
+ let allowBookmarking: Bool
let title: String
let emptyMessage: String
let emptyIcon: String
@@ -18,7 +18,6 @@ struct GenericListView<T: Identifiable & Hashable & GenericItem>: View {
let removeAction: (IndexSet) -> Void
let removeActionUUID: (UUID) -> Void
let removeAllAction: () -> Void
-
var filteredItems: [T] {
guard !searchText.isEmpty else {
return items
@@ -110,10 +109,12 @@ struct GenericListView<T: Identifiable & Hashable & GenericItem>: View {
Label("Add to Search", systemImage: "plus")
}
- Button(action: {
- settings.addBookmark(provider: settings.preferredBooru, tags: item.tags)
- }) {
- Label("Bookmark Tag\(item.tags.count == 1 ? "" : "s")", systemImage: "bookmark")
+ if allowBookmarking {
+ Button(action: {
+ settings.addBookmark(provider: settings.preferredBooru, tags: item.tags)
+ }) {
+ Label("Bookmark Tag\(item.tags.count == 1 ? "" : "s")", systemImage: "bookmark")
+ }
}
Button {
diff --git a/Sora/Views/Post/Grid/PostGridSearchHistoryView.swift b/Sora/Views/Post/Grid/PostGridSearchHistoryView.swift
index ae33c53..13baa41 100644
--- a/Sora/Views/Post/Grid/PostGridSearchHistoryView.swift
+++ b/Sora/Views/Post/Grid/PostGridSearchHistoryView.swift
@@ -9,6 +9,7 @@ struct PostGridSearchHistoryView: View {
GenericListView(
selectedTab: $selectedTab,
isPresented: $isPresented,
+ allowBookmarking: true,
title: "Search History",
emptyMessage: "No History",
emptyIcon: "magnifyingglass",