From 5345d27b4c0a3c33a40fb867ca5a3826315a0c64 Mon Sep 17 00:00:00 2001 From: silberengel Date: Sun, 3 Aug 2025 23:25:55 +0200 Subject: [PATCH] removed debug messages --- .../publication/[type]/[identifier]/+page.ts | 22 ------------------- 1 file changed, 22 deletions(-) diff --git a/src/routes/publication/[type]/[identifier]/+page.ts b/src/routes/publication/[type]/[identifier]/+page.ts index b2aefd4..8f3bbaf 100644 --- a/src/routes/publication/[type]/[identifier]/+page.ts +++ b/src/routes/publication/[type]/[identifier]/+page.ts @@ -4,17 +4,13 @@ import { fetchEventByDTag, fetchEventById, fetchEventByNaddr, fetchEventByNevent import type { NostrEvent } from "../../../../lib/utils/websocket_utils.ts"; export const load: PageLoad = async ({ params, parent }: { params: { type: string; identifier: string }; parent: any }) => { - console.debug(`[Publication Load] Page load function called with params:`, params); const { type, identifier } = params; - console.debug(`[Publication Load] About to call parent()...`); // Get layout data (no server-side data since SSR is disabled) const layoutData = await parent(); - console.debug(`[Publication Load] Layout data received:`, layoutData ? 'success' : 'null'); // AI-NOTE: Always fetch client-side since server-side fetch returns null for now let indexEvent: NostrEvent | null = null; - console.debug(`[Publication Load] Fetching client-side for: ${identifier}`); try { // Handle different identifier types @@ -26,9 +22,7 @@ export const load: PageLoad = async ({ params, parent }: { params: { type: strin indexEvent = await fetchEventByDTag(identifier); break; case 'naddr': - console.debug(`[Publication Load] Calling fetchEventByNaddr for: ${identifier}`); indexEvent = await fetchEventByNaddr(identifier); - console.debug(`[Publication Load] fetchEventByNaddr returned:`, indexEvent ? 'success' : 'null'); break; case 'nevent': indexEvent = await fetchEventByNevent(identifier); @@ -36,17 +30,13 @@ export const load: PageLoad = async ({ params, parent }: { params: { type: strin default: error(400, `Unsupported identifier type: ${type}`); } - - console.debug(`[Publication Load] Client-side indexEvent after fetch:`, indexEvent ? 'success' : 'null'); } catch (err) { - console.error(`[Publication Load] Error fetching event client-side:`, err); throw err; } if (!indexEvent) { // AI-NOTE: Handle case where no relays are available during preloading // This prevents 404 errors when relay stores haven't been populated yet - console.warn(`[Publication Load] Event not found for ${type}: ${identifier} - may be due to no relays available`); // Create appropriate search link based on type let searchParam = ''; @@ -68,22 +58,11 @@ export const load: PageLoad = async ({ params, parent }: { params: { type: strin error(404, `Event not found for ${type}: ${identifier}. href="/events?${searchParam}"`); } - console.debug(`[Publication Load] indexEvent details:`, { - id: indexEvent.id, - kind: indexEvent.kind, - pubkey: indexEvent.pubkey, - tags: indexEvent.tags.length, - contentLength: indexEvent.content.length - }); - const publicationType = indexEvent.tags.find((tag) => tag[0] === "type")?.[1] ?? ""; - - console.debug(`[Publication Load] publicationType:`, publicationType); // AI-NOTE: Use proper NDK instance from layout or create one with relays let ndk = layoutData?.ndk; if (!ndk) { - console.debug(`[Publication Load] Layout NDK not available, creating NDK instance with relays`); // Import NDK dynamically to avoid SSR issues const NDK = (await import("@nostr-dev-kit/ndk")).default; // Import initNdk to get properly configured NDK with relays @@ -97,6 +76,5 @@ export const load: PageLoad = async ({ params, parent }: { params: { type: strin ndk, // Use minimal NDK instance }; - console.debug(`[Publication Load] Returning result:`, result); return result; };