summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-03-18 06:53:14 -0700
committerFuwn <[email protected]>2025-03-18 06:57:57 -0700
commit47c77061c4e5cb8def06401c92c181fd63fda070 (patch)
tree7f65b776227ae4e8fb976dfd08e8843ec44ee1f3
parentfeat: Development commit (diff)
downloadsora-testing-47c77061c4e5cb8def06401c92c181fd63fda070.tar.xz
sora-testing-47c77061c4e5cb8def06401c92c181fd63fda070.zip
feat: Development commit
-rw-r--r--Localizable.xcstrings3
-rw-r--r--Sora/Views/Generic/GenericListView.swift14
2 files changed, 15 insertions, 2 deletions
diff --git a/Localizable.xcstrings b/Localizable.xcstrings
index 975e76a..37ea4bc 100644
--- a/Localizable.xcstrings
+++ b/Localizable.xcstrings
@@ -367,6 +367,9 @@
}
}
}
+ },
+ "Unookmark Tag%@" : {
+
}
},
"version" : "1.0"
diff --git a/Sora/Views/Generic/GenericListView.swift b/Sora/Views/Generic/GenericListView.swift
index acc8a6e..53f6bac 100644
--- a/Sora/Views/Generic/GenericListView.swift
+++ b/Sora/Views/Generic/GenericListView.swift
@@ -110,10 +110,20 @@ struct GenericListView<T: Identifiable & Hashable & GenericItem>: View {
}
if allowBookmarking {
+ let isBookmarked = settings.bookmarks.contains { $0.tags == item.tags }
+
Button(action: {
- settings.addBookmark(provider: settings.preferredBooru, tags: item.tags)
+ if isBookmarked {
+ settings.removeBookmark(withTags: item.tags)
+ } else {
+ settings.addBookmark(provider: settings.preferredBooru, tags: item.tags)
+ }
}) {
- Label("Bookmark Tag\(item.tags.count == 1 ? "" : "s")", systemImage: "bookmark")
+ if isBookmarked {
+ Label("Unookmark Tag\(item.tags.count == 1 ? "" : "s")", systemImage: "bookmark.fill")
+ } else {
+ Label("Bookmark Tag\(item.tags.count == 1 ? "" : "s")", systemImage: "bookmark")
+ }
}
}