diff --git a/src/layouts/PrimaryPageLayout/index.tsx b/src/layouts/PrimaryPageLayout/index.tsx index a1400a59..135249a2 100644 --- a/src/layouts/PrimaryPageLayout/index.tsx +++ b/src/layouts/PrimaryPageLayout/index.tsx @@ -3,6 +3,7 @@ import { Titlebar } from '@/components/Titlebar' import { ScrollArea } from '@/components/ui/scroll-area' import { TPrimaryPageName, usePrimaryPage } from '@/PageManager' import { DeepBrowsingProvider } from '@/providers/DeepBrowsingProvider' +import { useNostr } from '@/providers/NostrProvider' import { useUserPreferences } from '@/providers/UserPreferencesProvider' import { forwardRef, useEffect, useImperativeHandle, useRef } from 'react' @@ -23,6 +24,7 @@ const PrimaryPageLayout = forwardRef( }, ref ) => { + const { pubkey } = useNostr() const scrollAreaRef = useRef(null) const smallScreenScrollAreaRef = useRef(null) const smallScreenLastScrollTopRef = useRef(0) @@ -67,6 +69,10 @@ const PrimaryPageLayout = forwardRef( } }, [current, enableSingleColumnLayout, display]) + useEffect(() => { + smallScreenLastScrollTopRef.current = 0 + }, [pubkey]) + if (enableSingleColumnLayout) { return (