diff options
| author | Fuwn <[email protected]> | 2025-07-08 07:56:44 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-07-08 07:56:44 -0700 |
| commit | f2b1dab2ea2650346012d883a8e9138b25db8525 (patch) | |
| tree | 0b1c39d338c8ca45c94f47254eb93d667f3964ae /Sora/Views/BookmarkMenuButtonView.swift | |
| parent | feat: Development commit (diff) | |
| download | sora-testing-f2b1dab2ea2650346012d883a8e9138b25db8525.tar.xz sora-testing-f2b1dab2ea2650346012d883a8e9138b25db8525.zip | |
feat: Development commit
Diffstat (limited to 'Sora/Views/BookmarkMenuButtonView.swift')
| -rw-r--r-- | Sora/Views/BookmarkMenuButtonView.swift | 9 |
1 files changed, 9 insertions, 0 deletions
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 + } + } } |