From 88362e976ae8892c10c6068d7b8a2b54780cba3d Mon Sep 17 00:00:00 2001 From: Silberengel Date: Tue, 19 May 2026 14:36:08 +0200 Subject: [PATCH] bug-fix build --- src/contexts/primary-note-view-context.tsx | 1 + src/hooks/useProfileReportsEvents.tsx | 5 +++-- src/hooks/useProfileTimeline.tsx | 1 - src/lib/profile-reports-relays.ts | 10 ++++++++-- src/services/client-replaceable-events.service.ts | 2 +- src/services/navigation.service.ts | 2 ++ 6 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/contexts/primary-note-view-context.tsx b/src/contexts/primary-note-view-context.tsx index 5289a92a..3f0ef40b 100644 --- a/src/contexts/primary-note-view-context.tsx +++ b/src/contexts/primary-note-view-context.tsx @@ -13,6 +13,7 @@ export type TPrimaryOverlayViewType = | 'pins' | 'interests' | 'user-emojis' + | 'profile-badges' | 'notification-thread-follow' | 'notification-thread-mute' | 'others-relay-settings' diff --git a/src/hooks/useProfileReportsEvents.tsx b/src/hooks/useProfileReportsEvents.tsx index 919f24e5..ffc0573c 100644 --- a/src/hooks/useProfileReportsEvents.tsx +++ b/src/hooks/useProfileReportsEvents.tsx @@ -10,8 +10,9 @@ import { useDeletedEvent } from '@/providers/DeletedEventProvider' import { useFavoriteRelays } from '@/providers/FavoriteRelaysProvider' import { useNostrOptional } from '@/providers/nostr-context' import client from '@/services/client.service' +import type { TSubRequestFilter } from '@/types' import { useCallback, useEffect, useMemo, useRef, useState, type Dispatch, type SetStateAction } from 'react' -import { Event, kinds, type Filter } from 'nostr-tools' +import { Event, kinds } from 'nostr-tools' const REPORT_KINDS = [kinds.Report, ExtendedKind.REPORT] as const const CACHE_DURATION = 5 * 60 * 1000 @@ -51,7 +52,7 @@ function eventsEqualById(a: Event[], b: Event[]): boolean { type FetchMode = 'received' | 'made' -function buildFilter(pubkey: string, mode: FetchMode, limit: number): Filter { +function buildFilter(pubkey: string, mode: FetchMode, limit: number): TSubRequestFilter { if (mode === 'made') { return { authors: [pubkey], kinds: [...REPORT_KINDS], limit } } diff --git a/src/hooks/useProfileTimeline.tsx b/src/hooks/useProfileTimeline.tsx index 7b29d447..e8551d31 100644 --- a/src/hooks/useProfileTimeline.tsx +++ b/src/hooks/useProfileTimeline.tsx @@ -282,7 +282,6 @@ export function useProfileTimeline({ } const hasCalendarKinds = kinds.some((k) => CALENDAR_EVENT_KINDS.includes(k)) - const socialKinds = kinds.some(isSocialKindBlockedKind) const emptyAuthor = { read: [] as string[], write: [] as string[], httpRead: [] as string[], httpWrite: [] as string[] } const idbDocKinds = kinds.filter((k) => isDocumentRelayKind(k)) diff --git a/src/lib/profile-reports-relays.ts b/src/lib/profile-reports-relays.ts index c3f8aa75..2bc04826 100644 --- a/src/lib/profile-reports-relays.ts +++ b/src/lib/profile-reports-relays.ts @@ -27,9 +27,15 @@ export function buildProfileReportsRelayUrls( const blocked = new Set( blockedRelays.map((b) => normalizeAnyRelayUrl(b) || b).filter(Boolean) ) + const mailboxList = { + read: authorRelayList.read ?? [], + write: authorRelayList.write ?? [], + httpRead: authorRelayList.httpRead, + httpWrite: authorRelayList.httpWrite + } const list = options.includeAuthorLocalRelays - ? authorRelayList - : stripMailboxLocalUrlsForRemoteViewers(authorRelayList) + ? mailboxList + : stripMailboxLocalUrlsForRemoteViewers(mailboxList) const inboxLayer = relayUrlsLocalsFirst([...(list.httpRead ?? []), ...(list.read ?? [])]) const cacheLayer = relayUrlsLocalsFirst( (options.cacheRelayUrls ?? []).filter((u) => { diff --git a/src/services/client-replaceable-events.service.ts b/src/services/client-replaceable-events.service.ts index 78ec1fe0..6eb9e899 100644 --- a/src/services/client-replaceable-events.service.ts +++ b/src/services/client-replaceable-events.service.ts @@ -1452,7 +1452,7 @@ export class ReplaceableEventService { } } - const legacyProfileBadges = legacyProfileBadgeRows.filter(shouldDropEventOnIngest).reduce< + const legacyProfileBadges = legacyProfileBadgeRows.filter((e) => !shouldDropEventOnIngest(e)).reduce< NEvent | undefined >((best, e) => (!best || e.created_at > best.created_at ? e : best), undefined) diff --git a/src/services/navigation.service.ts b/src/services/navigation.service.ts index f00459d4..4ce2a645 100644 --- a/src/services/navigation.service.ts +++ b/src/services/navigation.service.ts @@ -46,6 +46,7 @@ export type ViewType = | 'pins' | 'interests' | 'user-emojis' + | 'profile-badges' | 'notification-thread-follow' | 'notification-thread-mute' | 'others-relay-settings' @@ -300,6 +301,7 @@ export class NavigationService { if (viewType === 'pins') return 'Pinned notes' if (viewType === 'interests') return 'Interests' if (viewType === 'user-emojis') return 'Custom emoji list' + if (viewType === 'profile-badges') return 'Profile badges' if (viewType === 'others-relay-settings') return 'Relays and Storage Settings' return 'Page' }