fix: completed books now have 100% progress (#625)

This commit is contained in:
Huang Xin
2025-03-18 13:00:33 +08:00
committed by GitHub
parent 7648aa47b2
commit 72e6c058f5
8 changed files with 18 additions and 10 deletions
@@ -70,7 +70,9 @@ const FooterBar: React.FC<FooterBarProps> = ({
const isVisible = hoveredBookKey === bookKey;
const progressInfo = bookFormat === 'PDF' ? section : pageinfo;
const progressValid = !!progressInfo;
const progressFraction = progressValid ? (progressInfo!.current + 1) / progressInfo!.total : 0;
const progressFraction = progressValid
? ((progressInfo!.next ?? progressInfo!.current) + 1) / progressInfo!.total
: 0;
return (
<>
@@ -32,7 +32,7 @@ const PageInfoView: React.FC<PageInfoProps> = ({
? _(
isVertical ? '{{currentPage}} · {{totalPage}}' : 'Loc. {{currentPage}} / {{totalPage}}',
{
currentPage: pageinfo.current + 1,
currentPage: (pageinfo.next ?? pageinfo.current) + 1,
totalPage: pageinfo.total,
},
)
@@ -32,7 +32,12 @@ const SectionInfo: React.FC<SectionInfoProps> = ({
: { paddingLeft: `${horizontalGap}%` }
}
>
<h2 className={clsx('text-neutral-content text-center font-sans text-xs font-light')}>
<h2
className={clsx(
'text-neutral-content text-center font-sans text-xs font-light',
isVertical ? '' : 'line-clamp-1',
)}
>
{section || ''}
</h2>
</div>