Render progress bars only when visible

This commit is contained in:
schroda
2024-12-22 13:53:35 +01:00
parent f141a5ae66
commit 7e9684b7d3
2 changed files with 8 additions and 0 deletions

View File

@@ -50,6 +50,10 @@ const BaseMobileReaderProgressBar = ({
return () => setIsMaximized(false);
}, [isVisible]);
if (!isVisible) {
return null;
}
return (
<ReaderProgressBarDirectionWrapper>
<Stack

View File

@@ -52,6 +52,10 @@ const BaseStandardReaderProgressBar = ({
const isHidden = progressBarType === ProgressBarType.HIDDEN;
const isMinimized = !isMaximized && !isDragging;
if (isHidden) {
return null;
}
// the progress bar uses the reading direction to set the themes direction, thus, stuff has to be adjusted to still be correctly positioned
// depending on which combination of theme direction and reading direction is currently active
return (