Fix downloaded consideration of manga without any chapters

This commit is contained in:
schroda
2026-06-07 13:23:27 +02:00
parent c2b2516a93
commit ef9e65cf9a
3 changed files with 15 additions and 10 deletions

View File

@@ -82,10 +82,10 @@ export const MangaActionMenuItems = ({
const shouldShowMenuItem = createShouldShowMenuItem(isSingleMode);
const isMenuItemDisabled = createIsMenuItemDisabled(isSingleMode);
const isFullyDownloaded = !!manga && manga.downloadCount === manga.chapters.totalCount;
const hasDownloadedChapters = !!manga?.downloadCount;
const hasUnreadChapters = !!manga?.unreadCount;
const hasReadChapters = !!manga && manga.unreadCount !== manga.chapters.totalCount;
const isPartiallyDownloaded = !!manga && Mangas.isPartiallyDownloaded(manga);
const hasDownloadedChapters = manga && Mangas.isPartiallyDownloaded(manga);
const hasUnreadChapters = manga && Mangas.isPartiallyRead(manga);
const hasReadChapters = !!manga && Mangas.isPartiallyRead(manga);
const handleSelect = () => {
handleSelection?.(manga.id, true);
@@ -121,7 +121,7 @@ export const MangaActionMenuItems = ({
{!!handleSelection && isSingleMode && (
<MenuItem onClick={handleSelect} Icon={CheckBoxOutlineBlank} title={t`Select`} />
)}
{shouldShowMenuItem(!isFullyDownloaded) && (
{shouldShowMenuItem(isPartiallyDownloaded) && (
<NestedMenuItem
disabled={isMenuItemDisabled(!downloadableMangas.length)}
LeftIcon={Download}