fix: completed books now have 100% progress (#625)
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user