|
|
|
@ -1,11 +1,11 @@ |
|
|
|
import { error } from '@sveltejs/kit'; |
|
|
|
import { error } from '@sveltejs/kit'; |
|
|
|
import { NDKRelay, NDKRelaySet, type NDKEvent } from '@nostr-dev-kit/ndk'; |
|
|
|
import type { NDKEvent } from '@nostr-dev-kit/ndk'; |
|
|
|
import type { PageLoad } from './$types'; |
|
|
|
import type { PageLoad } from './$types'; |
|
|
|
import { get } from 'svelte/store'; |
|
|
|
import { getActiveRelays } from '$lib/ndk.ts'; |
|
|
|
import { getActiveRelays, inboxRelays, ndkInstance } from '$lib/ndk'; |
|
|
|
import { setContext } from 'svelte'; |
|
|
|
import { standardRelays } from '$lib/consts'; |
|
|
|
import { PublicationTree } from '$lib/data_structures/publication_tree.ts'; |
|
|
|
|
|
|
|
|
|
|
|
export const load: PageLoad = async ({ url, parent }) => { |
|
|
|
export const load: PageLoad = async ({ url, parent }: { url: URL; parent: () => Promise<any> }) => { |
|
|
|
const id = url.searchParams.get('id'); |
|
|
|
const id = url.searchParams.get('id'); |
|
|
|
const dTag = url.searchParams.get('d'); |
|
|
|
const dTag = url.searchParams.get('d'); |
|
|
|
|
|
|
|
|
|
|
|
@ -41,6 +41,8 @@ export const load: PageLoad = async ({ url, parent }) => { |
|
|
|
const publicationType = indexEvent?.getMatchingTags('type')[0]?.[1]; |
|
|
|
const publicationType = indexEvent?.getMatchingTags('type')[0]?.[1]; |
|
|
|
const fetchPromise = parser.fetch(indexEvent); |
|
|
|
const fetchPromise = parser.fetch(indexEvent); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setContext('publicationTree', new PublicationTree(indexEvent, ndk)); |
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
return { |
|
|
|
waitable: fetchPromise, |
|
|
|
waitable: fetchPromise, |
|
|
|
publicationType, |
|
|
|
publicationType, |
|
|
|
|