mirror of
https://github.com/lumina-rocks/lumina.git
synced 2026-06-04 09:41:32 +02:00
do not display a kind20 note if image does not start with "http" to prevent non-url errors
This commit is contained in:
@@ -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", " ")
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user