From 47c77061c4e5cb8def06401c92c181fd63fda070 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Tue, 18 Mar 2025 06:53:14 -0700 Subject: feat: Development commit --- Localizable.xcstrings | 3 +++ 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: 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") + } } } -- cgit v1.2.3