do not display a kind20 note if image does not start with "http" to prevent non-url errors

This commit is contained in:
mr0x50
2025-02-15 21:02:03 +01:00
parent a737463115
commit 2d923feda2
2 changed files with 3 additions and 3 deletions

View File

@@ -39,8 +39,8 @@ const KIND20Card: React.FC<KIND20CardProps> = ({
})
const [imageError, setImageError] = useState(false);
if (!image || imageError) return null;
if (!image || !image.startsWith("http") || imageError) return null;
const title =
userData?.username || userData?.display_name || userData?.name || userData?.npub || nip19.npubEncode(pubkey)
text = text.replaceAll("\n", " ")

View File

@@ -27,7 +27,7 @@ const QuickViewKind20NoteCard: React.FC<QuickViewKind20NoteCardProps> = ({ pubke
});
const [imageError, setImageError] = useState(false);
if (!image || imageError) return null;
if (!image || !image.startsWith("http") || imageError) return null;
text = text.replaceAll('\n', ' ');
const encodedNoteId = nip19.noteEncode(event.id)