diff --git a/src/config/nostrGateways.ts b/src/config/nostrGateways.ts index d52721da..5316a6fd 100644 --- a/src/config/nostrGateways.ts +++ b/src/config/nostrGateways.ts @@ -20,8 +20,15 @@ export function getEventUrl(nevent: string): string { /** * Get a general nostr link on the gateway + * Automatically detects if it's a profile (npub/nprofile) or event (note/nevent/naddr) */ export function getNostrUrl(identifier: string): string { - return `${NOSTR_GATEWAY}/${identifier}` + // Check the prefix to determine if it's a profile or event + if (identifier.startsWith('npub') || identifier.startsWith('nprofile')) { + return `${NOSTR_GATEWAY}/p/${identifier}` + } + + // Everything else (note, nevent, naddr) goes to /e/ + return `${NOSTR_GATEWAY}/e/${identifier}` }