From 92b78d45730d85826d4e6f9e94efc7f43ae71a47 Mon Sep 17 00:00:00 2001 From: codytseng Date: Sat, 25 Jan 2025 18:24:29 +0800 Subject: [PATCH] feat: increase the number of relays used for finding user notes --- src/PageManager.tsx | 5 ++++- src/pages/secondary/ProfilePage/index.tsx | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/PageManager.tsx b/src/PageManager.tsx index 2e65b8a1..5922cdec 100644 --- a/src/PageManager.tsx +++ b/src/PageManager.tsx @@ -74,12 +74,15 @@ export function PageManager({ maxStackSize = 5 }: { maxStackSize?: number }) { setSecondaryStack((prevStack) => { if (isCurrentPage(prevStack, url)) return prevStack - const { newStack } = pushNewPageToStack( + const { newStack, newItem } = pushNewPageToStack( prevStack, url, maxStackSize, window.history.state?.index ) + if (newItem) { + window.history.replaceState({ index: newItem.index, url }, '', url) + } return newStack }) } diff --git a/src/pages/secondary/ProfilePage/index.tsx b/src/pages/secondary/ProfilePage/index.tsx index b2b69bc5..bd59b230 100644 --- a/src/pages/secondary/ProfilePage/index.tsx +++ b/src/pages/secondary/ProfilePage/index.tsx @@ -3,6 +3,7 @@ import Nip05 from '@/components/Nip05' import NoteList from '@/components/NoteList' import ProfileAbout from '@/components/ProfileAbout' import ProfileBanner from '@/components/ProfileBanner' +import ProfileOptions from '@/components/ProfileOptions' import PubkeyCopy from '@/components/PubkeyCopy' import QrCodePopover from '@/components/QrCodePopover' import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar' @@ -27,7 +28,6 @@ import { useNostr } from '@/providers/NostrProvider' import { useMemo } from 'react' import { useTranslation } from 'react-i18next' import NotFoundPage from '../NotFoundPage' -import ProfileOptions from '@/components/ProfileOptions' export default function ProfilePage({ id, index }: { id?: string; index?: number }) { const { t } = useTranslation() @@ -39,7 +39,7 @@ export default function ProfilePage({ id, index }: { id?: string; index?: number () => relayList.write.length < 4 ? relayList.write.concat(currentRelayUrls).slice(0, 4) - : relayList.write.slice(0, 4), + : relayList.write.slice(0, 8), [relayList, currentRelayUrls] ) const { pubkey: accountPubkey } = useNostr()