Skip to content

Commit

Permalink
Allow Epub generation from multiple bookmarks hoarder-app#295
Browse files Browse the repository at this point in the history
hiding the bulk action if there is no link bookmark
  • Loading branch information
kamtschatka committed Nov 22, 2024
1 parent 5330223 commit 3850f13
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions apps/web/components/dashboard/BulkBookmarksAction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,20 @@ export default function BulkBookmarksAction() {
name: t("actions.download_epub"),
icon: (
<a
href={`/api/epub?${selectedBookmarks.map((bookmark) => "assetId=" + bookmark.id).join("&")}`}
href={`/api/epub?${selectedBookmarks
.filter((item) => item.content.type === BookmarkTypes.LINK)
.map((bookmark) => "assetId=" + bookmark.id)
.join("&")}`}
>
<Download size={18} />
</a>
),
isPending: false,
hidden: !isBulkEditEnabled,
hidden:
!isBulkEditEnabled ||
selectedBookmarks.filter(
(item) => item.content.type === BookmarkTypes.LINK,
).length === 0,
},
{
name: t("actions.refresh"),
Expand Down

0 comments on commit 3850f13

Please sign in to comment.