use window to track scrolling for /app web routes

This commit is contained in:
Satindar Dhillon
2022-03-09 09:48:30 -08:00
parent b1b3915b7b
commit bf035a4ec4
2 changed files with 6 additions and 2 deletions

View File

@ -79,6 +79,12 @@ export function Article(props: ArticleProps): JSX.Element {
scrollContainer.scrollHeight
setReadingProgress(newReadingProgress * 100)
} else if (window && window.document.scrollingElement) {
const newReadingProgress =
window.scrollY / window.document.scrollingElement.scrollHeight
const adjustedReadingProgress =
newReadingProgress > 0.92 ? 1 : newReadingProgress
setReadingProgress(adjustedReadingProgress * 100)
}
},
1000

View File

@ -67,9 +67,7 @@ function AppArticleEmbedContent(
if (articleData) {
return (
<Box
ref={scrollRef}
css={{
position: 'fixed',
overflowY: 'auto',
height: '100%',
width: '100vw',