diff options
| author | Fuwn <[email protected]> | 2025-03-18 06:53:14 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-03-18 06:57:57 -0700 |
| commit | 47c77061c4e5cb8def06401c92c181fd63fda070 (patch) | |
| tree | 7f65b776227ae4e8fb976dfd08e8843ec44ee1f3 | |
| parent | feat: Development commit (diff) | |
| download | sora-testing-47c77061c4e5cb8def06401c92c181fd63fda070.tar.xz sora-testing-47c77061c4e5cb8def06401c92c181fd63fda070.zip | |
feat: Development commit
| -rw-r--r-- | Localizable.xcstrings | 3 | ||||
| -rw-r--r-- | Sora/Views/Generic/GenericListView.swift | 14 |
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") + } } } |