Properly update "StandardReaderProgressBar" slots on "progress bar position" change
"createProgressBarSlot" was never called in case the function reference changed but none of the passed arguments
This commit is contained in:
@@ -73,6 +73,7 @@ export const ReaderProgressBarSlotWrapper = memo(
|
|||||||
totalPages,
|
totalPages,
|
||||||
),
|
),
|
||||||
[
|
[
|
||||||
|
createProgressBarSlot,
|
||||||
page,
|
page,
|
||||||
pagesIndex,
|
pagesIndex,
|
||||||
primaryPageLoadState,
|
primaryPageLoadState,
|
||||||
|
|||||||
@@ -20,28 +20,27 @@ export const ReaderProgressBarSlotDesktop = memo(
|
|||||||
pageUrl,
|
pageUrl,
|
||||||
primaryPageLoadState,
|
primaryPageLoadState,
|
||||||
secondaryPageLoadState,
|
secondaryPageLoadState,
|
||||||
isHorizontal,
|
|
||||||
isVertical,
|
|
||||||
progressBarPosition,
|
progressBarPosition,
|
||||||
isCurrentPage,
|
isCurrentPage,
|
||||||
isFirstPage,
|
isFirstPage,
|
||||||
isLastPage,
|
isLastPage,
|
||||||
isLeadingPage,
|
isLeadingPage,
|
||||||
isDragging,
|
isDragging,
|
||||||
}: Pick<IReaderSettings, 'progressBarPosition'> &
|
}: Pick<IReaderSettings, 'progressBarPosition'> & {
|
||||||
Pick<ReturnType<typeof getProgressBarPositionInfo>, 'isHorizontal' | 'isVertical'> & {
|
pageName: string;
|
||||||
pageName: string;
|
pageUrl: string;
|
||||||
pageUrl: string;
|
primaryPageLoadState: boolean;
|
||||||
primaryPageLoadState: boolean;
|
secondaryPageLoadState?: boolean;
|
||||||
secondaryPageLoadState?: boolean;
|
isCurrentPage: boolean;
|
||||||
isCurrentPage: boolean;
|
isFirstPage: boolean;
|
||||||
isFirstPage: boolean;
|
isLastPage: boolean;
|
||||||
isLastPage: boolean;
|
isLeadingPage: boolean;
|
||||||
isLeadingPage: boolean;
|
isDragging: boolean;
|
||||||
isDragging: boolean;
|
}) => {
|
||||||
}) => {
|
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
|
|
||||||
|
const { isVertical, isHorizontal } = getProgressBarPositionInfo(progressBarPosition);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ReaderProgressBarSlot
|
<ReaderProgressBarSlot
|
||||||
key={pageUrl}
|
key={pageUrl}
|
||||||
|
|||||||
@@ -71,8 +71,6 @@ const BaseStandardReaderProgressBar = ({
|
|||||||
pageUrl={page.primary.url}
|
pageUrl={page.primary.url}
|
||||||
primaryPageLoadState={primaryPageLoadState}
|
primaryPageLoadState={primaryPageLoadState}
|
||||||
secondaryPageLoadState={secondaryPageLoadState}
|
secondaryPageLoadState={secondaryPageLoadState}
|
||||||
isHorizontal={isHorizontal}
|
|
||||||
isVertical={isVertical}
|
|
||||||
progressBarPosition={progressBarPosition}
|
progressBarPosition={progressBarPosition}
|
||||||
isCurrentPage={isCurrentPage}
|
isCurrentPage={isCurrentPage}
|
||||||
isFirstPage={pagesIndex === 0}
|
isFirstPage={pagesIndex === 0}
|
||||||
@@ -81,7 +79,7 @@ const BaseStandardReaderProgressBar = ({
|
|||||||
isDragging={isDragging}
|
isDragging={isDragging}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
[isHorizontal, isVertical, isDragging, progressBarPosition],
|
[progressBarPosition, isDragging],
|
||||||
)}
|
)}
|
||||||
slotProps={{
|
slotProps={{
|
||||||
container: {
|
container: {
|
||||||
|
|||||||
Reference in New Issue
Block a user