Browse Source

bug-fix build

imwald
Silberengel 4 weeks ago
parent
commit
88362e976a
  1. 1
      src/contexts/primary-note-view-context.tsx
  2. 5
      src/hooks/useProfileReportsEvents.tsx
  3. 1
      src/hooks/useProfileTimeline.tsx
  4. 10
      src/lib/profile-reports-relays.ts
  5. 2
      src/services/client-replaceable-events.service.ts
  6. 2
      src/services/navigation.service.ts

1
src/contexts/primary-note-view-context.tsx

@ -13,6 +13,7 @@ export type TPrimaryOverlayViewType = @@ -13,6 +13,7 @@ export type TPrimaryOverlayViewType =
| 'pins'
| 'interests'
| 'user-emojis'
| 'profile-badges'
| 'notification-thread-follow'
| 'notification-thread-mute'
| 'others-relay-settings'

5
src/hooks/useProfileReportsEvents.tsx

@ -10,8 +10,9 @@ import { useDeletedEvent } from '@/providers/DeletedEventProvider' @@ -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 { @@ -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 }
}

1
src/hooks/useProfileTimeline.tsx

@ -282,7 +282,6 @@ export function useProfileTimeline({ @@ -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))

10
src/lib/profile-reports-relays.ts

@ -27,9 +27,15 @@ export function buildProfileReportsRelayUrls( @@ -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) => {

2
src/services/client-replaceable-events.service.ts

@ -1452,7 +1452,7 @@ export class ReplaceableEventService { @@ -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)

2
src/services/navigation.service.ts

@ -46,6 +46,7 @@ export type ViewType = @@ -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 { @@ -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'
}

Loading…
Cancel
Save