refactor: clean up npub/nprofile display implementation

- Remove all debug console.log/error statements (39+) and ts() helpers
- Eliminate redundant localStorage cache check in useProfileLabels
- Standardize fallback display format using getNpubFallbackDisplay() utility
- Update ResolvedMention to use npub format consistently
This commit is contained in:
Gigi
2025-11-02 21:26:06 +01:00
parent 5d36d6de4f
commit 5e1ed6b8de
4 changed files with 40 additions and 139 deletions

View File

@@ -3,6 +3,7 @@ import { Link } from 'react-router-dom'
import { useEventModel } from 'applesauce-react/hooks'
import { Models, Helpers } from 'applesauce-core'
import { decode, npubEncode } from 'nostr-tools/nip19'
import { getNpubFallbackDisplay } from '../utils/nostrUriResolver'
const { getPubkeyFromDecodeResult } = Helpers
@@ -20,7 +21,7 @@ const ResolvedMention: React.FC<ResolvedMentionProps> = ({ encoded }) => {
}
const profile = pubkey ? useEventModel(Models.ProfileModel, [pubkey]) : undefined
const display = profile?.name || profile?.display_name || profile?.nip05 || (pubkey ? `${pubkey.slice(0, 8)}...` : encoded)
const display = profile?.name || profile?.display_name || profile?.nip05 || (pubkey ? getNpubFallbackDisplay(pubkey) : encoded)
const npub = pubkey ? npubEncode(pubkey) : undefined
if (npub) {