diff --git a/packages/web/components/templates/PrimaryLayout.tsx b/packages/web/components/templates/PrimaryLayout.tsx index f0764cb84..74bd10dbd 100644 --- a/packages/web/components/templates/PrimaryLayout.tsx +++ b/packages/web/components/templates/PrimaryLayout.tsx @@ -85,32 +85,24 @@ export function PrimaryLayout(props: PrimaryLayoutProps): JSX.Element { ) : null} - - {props.children} - {showLogoutConfirmation ? ( - setShowLogoutConfirmation(false)} - /> - ) : null} - {showKeyboardCommandsModal ? ( - setShowKeyboardCommandsModal(false)} - /> - ) : null} - + {props.children} + {showLogoutConfirmation ? ( + setShowLogoutConfirmation(false)} + /> + ) : null} + {showKeyboardCommandsModal ? ( + setShowKeyboardCommandsModal(false)} + /> + ) : null}
diff --git a/packages/web/components/templates/article/Article.tsx b/packages/web/components/templates/article/Article.tsx index c2fed68ca..01dfe3354 100644 --- a/packages/web/components/templates/article/Article.tsx +++ b/packages/web/components/templates/article/Article.tsx @@ -86,9 +86,22 @@ export function Article(props: ArticleProps): JSX.Element { window.scrollY / window.document.scrollingElement.scrollHeight const adjustedReadingProgress = newReadingProgress > 0.92 ? 1 : newReadingProgress + + const bottomProgress = + (window.scrollY + window.document.scrollingElement.clientHeight) / + window.document.scrollingElement.scrollHeight + + console.log( + 'newOffset Top: ', + newReadingProgress, + 'newOffset Bottom: ', + bottomProgress, + window.scrollY, + window.document.scrollingElement.scrollHeight + ) debouncedSetReadingProgress(adjustedReadingProgress * 100) } - }, 1000) + }, 2500) // Scroll to initial anchor position useEffect(() => { diff --git a/packages/web/lib/themeUpdater.tsx b/packages/web/lib/themeUpdater.tsx index 1b4694449..6a99fbe72 100644 --- a/packages/web/lib/themeUpdater.tsx +++ b/packages/web/lib/themeUpdater.tsx @@ -37,7 +37,6 @@ function getTheme(themeId: string) { export function updateThemeLocally(themeId: string): void { if (typeof window !== 'undefined') { - console.trace('storing theme: ', themeId) window.localStorage.setItem(themeKey, themeId) } @@ -91,7 +90,6 @@ export function applyStoredTheme(syncWithServer = true): ThemeId | undefined { | ThemeId | undefined if (theme && Object.values(ThemeId).includes(theme)) { - console.log('applying stored theme: ', theme) updateThemeLocally(theme) } return theme diff --git a/packages/web/pages/app/[username]/[slug]/index.tsx b/packages/web/pages/app/[username]/[slug]/index.tsx index f7498acc4..a4de3c6d3 100644 --- a/packages/web/pages/app/[username]/[slug]/index.tsx +++ b/packages/web/pages/app/[username]/[slug]/index.tsx @@ -73,13 +73,7 @@ function AppArticleEmbedContent( if (articleData) { return ( - +