use window to track scrolling for /app web routes
This commit is contained in:
@ -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
|
||||
|
||||
@ -67,9 +67,7 @@ function AppArticleEmbedContent(
|
||||
if (articleData) {
|
||||
return (
|
||||
<Box
|
||||
ref={scrollRef}
|
||||
css={{
|
||||
position: 'fixed',
|
||||
overflowY: 'auto',
|
||||
height: '100%',
|
||||
width: '100vw',
|
||||
|
||||
Reference in New Issue
Block a user