From c301dc86c3cb30346a4d719b032b7e25ebfbe114 Mon Sep 17 00:00:00 2001 From: Silberengel Date: Fri, 22 May 2026 15:33:18 +0200 Subject: [PATCH] bug-fixes --- src/PageManager.tsx | 5 ----- src/lib/nip05.ts | 8 +++++--- src/services/client-query.service.ts | 1 - 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/PageManager.tsx b/src/PageManager.tsx index 0a226970..af3719ee 100644 --- a/src/PageManager.tsx +++ b/src/PageManager.tsx @@ -129,7 +129,6 @@ const PrimaryProfileBadgesListPageLazy = lazy(() => import('@/pages/secondary/Pr const PrimaryInterestListPageLazy = lazy(() => import('@/pages/secondary/InterestListPage')) const PrimaryUserEmojiListPageLazy = lazy(() => import('@/pages/secondary/UserEmojiListPage')) const PrimaryOthersRelaySettingsPageLazy = lazy(() => import('@/pages/secondary/OthersRelaySettingsPage')) -const SecondaryRelayPageLazy = lazy(() => import('@/pages/secondary/RelayPage')) function suspensePrimaryPage(page: ReactElement) { return {page} @@ -588,9 +587,7 @@ export function useSmartNoteNavigationOptional() { // Fixed: Relay navigation now uses primary note view on mobile, secondary routing (drawer in single-pane, side panel in double-pane) on desktop export function useSmartRelayNavigation() { - const { setPrimaryNoteView } = usePrimaryNoteView() const { push: pushSecondaryPage } = useSecondaryPage() - const { isSmallScreen } = useScreenSize() const { current: currentPrimaryPage } = usePrimaryPage() const navigateToRelay = (url: string) => { @@ -620,9 +617,7 @@ export function useSmartRelayNavigationOptional() { if (!primaryNoteView || !secondaryPage || !screenSize || !primaryPage) { return { navigateToRelay: (url: string) => { window.location.href = url } } } - const { setPrimaryNoteView } = primaryNoteView const { push: pushSecondaryPage } = secondaryPage - const { isSmallScreen } = screenSize const { current: currentPrimaryPage } = primaryPage const navigateToRelay = (url: string) => { const relayUrlMatch = diff --git a/src/lib/nip05.ts b/src/lib/nip05.ts index e6677dd6..4a7913e8 100644 --- a/src/lib/nip05.ts +++ b/src/lib/nip05.ts @@ -20,8 +20,10 @@ type TVerifyNip05Result = { /** Bumps when verification rules change so LRU does not serve stale false negatives. */ const VERIFY_CACHE_SCHEMA = 4 +type WellKnownCacheEntry = { json: Record | null } + /** Per-domain `nostr.json` (or negative `null`) so feeds do not re-fetch every NIP-05 on the same host. */ -const wellKnownJsonByDomain = new LRUCache | null>({ max: 512 }) +const wellKnownJsonByDomain = new LRUCache({ max: 512 }) const wellKnownDomainInFlight = new Map | null>>() function normalizeNip05Domain(domain: string): string { @@ -252,12 +254,12 @@ async function getOrFetchWellKnownJsonForDomain( const key = normalizeNip05Domain(domain) if (!key) return null if (wellKnownJsonByDomain.has(key)) { - return wellKnownJsonByDomain.get(key) ?? null + return wellKnownJsonByDomain.get(key)!.json } let inflight = wellKnownDomainInFlight.get(key) if (!inflight) { inflight = fetchWellKnownNostrJsonNetwork(key, nameHint).then((json) => { - wellKnownJsonByDomain.set(key, json) + wellKnownJsonByDomain.set(key, { json }) wellKnownDomainInFlight.delete(key) return json }) diff --git a/src/services/client-query.service.ts b/src/services/client-query.service.ts index 03e4a3f5..32673cf0 100644 --- a/src/services/client-query.service.ts +++ b/src/services/client-query.service.ts @@ -1,5 +1,4 @@ import { - FAST_READ_RELAY_URLS, FEED_FIRST_RELAY_RESULT_GRACE_MIN_LIMIT, FIRST_RELAY_RESULT_GRACE_MS, relayFilterIncludesSocialKindBlockedKind,