diff --git a/src/components/nostr/kinds/IssueDetailRenderer.tsx b/src/components/nostr/kinds/IssueDetailRenderer.tsx index 17b0382..ffa3a49 100644 --- a/src/components/nostr/kinds/IssueDetailRenderer.tsx +++ b/src/components/nostr/kinds/IssueDetailRenderer.tsx @@ -14,6 +14,7 @@ import { getIssueTitle, getIssueLabels, getIssueRepositoryAddress, + getRepositoryRelays, getStatusType, getValidStatusAuthors, findCurrentStatus, @@ -24,7 +25,6 @@ import { RepositoryLink } from "../RepositoryLink"; import { useTimeline } from "@/hooks/useTimeline"; import { useNostrEvent } from "@/hooks/useNostrEvent"; import { formatTimestamp } from "@/hooks/useLocale"; -import { AGGREGATOR_RELAYS } from "@/services/loaders"; /** * Get the icon for a status kind @@ -90,6 +90,12 @@ export function IssueDetailRenderer({ event }: { event: NostrEvent }) { const repositoryEvent = useNostrEvent(repoPointer); + // Get relays configured in the repository for fetching status events + const statusRelays = useMemo( + () => (repositoryEvent ? getRepositoryRelays(repositoryEvent) : []), + [repositoryEvent], + ); + // Fetch status events that reference this issue // Status events use e tag with root marker to reference the issue const statusFilter = useMemo( @@ -103,7 +109,7 @@ export function IssueDetailRenderer({ event }: { event: NostrEvent }) { const { events: statusEvents, loading: statusLoading } = useTimeline( `issue-status-${event.id}`, statusFilter, - AGGREGATOR_RELAYS, + statusRelays, { limit: 20 }, ); diff --git a/src/components/nostr/kinds/IssueRenderer.tsx b/src/components/nostr/kinds/IssueRenderer.tsx index e8d1acb..d39a82b 100644 --- a/src/components/nostr/kinds/IssueRenderer.tsx +++ b/src/components/nostr/kinds/IssueRenderer.tsx @@ -9,6 +9,7 @@ import { getIssueTitle, getIssueLabels, getIssueRepositoryAddress, + getRepositoryRelays, getStatusType, getValidStatusAuthors, findCurrentStatus, @@ -18,7 +19,6 @@ import { Label } from "@/components/ui/label"; import { RepositoryLink } from "../RepositoryLink"; import { useTimeline } from "@/hooks/useTimeline"; import { useNostrEvent } from "@/hooks/useNostrEvent"; -import { AGGREGATOR_RELAYS } from "@/services/loaders"; /** * Get the icon for a status kind @@ -84,6 +84,12 @@ export function IssueRenderer({ event }: BaseEventProps) { const repositoryEvent = useNostrEvent(repoPointer); + // Get relays configured in the repository for fetching status events + const statusRelays = useMemo( + () => (repositoryEvent ? getRepositoryRelays(repositoryEvent) : []), + [repositoryEvent], + ); + // Fetch status events that reference this issue const statusFilter = useMemo( () => ({ @@ -96,7 +102,7 @@ export function IssueRenderer({ event }: BaseEventProps) { const { events: statusEvents } = useTimeline( `issue-status-${event.id}`, statusFilter, - AGGREGATOR_RELAYS, + statusRelays, { limit: 10 }, );