From f2b1dab2ea2650346012d883a8e9138b25db8525 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Tue, 8 Jul 2025 07:56:44 -0700 Subject: feat: Development commit --- Sora/Views/BookmarkMenuButtonView.swift | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Sora/Views/BookmarkMenuButtonView.swift') diff --git a/Sora/Views/BookmarkMenuButtonView.swift b/Sora/Views/BookmarkMenuButtonView.swift index c46894d..91009d0 100644 --- a/Sora/Views/BookmarkMenuButtonView.swift +++ b/Sora/Views/BookmarkMenuButtonView.swift @@ -39,6 +39,7 @@ struct BookmarkMenuButtonView: View { }) { Label(folder.name, systemImage: "folder") } + .disabled(isBookmarkedInFolder(folderId: folder.id)) } let topLevelFolders = settings.folders @@ -62,6 +63,7 @@ struct BookmarkMenuButtonView: View { }) { Text(folder.shortName) } + .disabled(isBookmarkedInFolder(folderId: folder.id)) } } label: { Text(topLevelName) @@ -98,4 +100,11 @@ struct BookmarkMenuButtonView: View { settings.bookmarks.append(newBookmark) } } + + private func isBookmarkedInFolder(folderId: UUID) -> Bool { + settings.bookmarks.contains { bookmark in + bookmark.folder == folderId && Set(bookmark.tags) == Set(tags) + && bookmark.provider == provider + } + } } -- cgit v1.2.3