fix small issues

This commit is contained in:
Ren Amamiya
2023-08-24 15:23:54 +07:00
parent 970115d059
commit 98687bd78b
7 changed files with 11 additions and 30 deletions

View File

@@ -25,7 +25,7 @@ export function TextNote({ event }: { event: NDKEvent }) {
components={{
del: ({ children }) => {
const key = children[0] as string;
if (!key) return;
if (typeof key !== 'string') return;
if (key.startsWith('pub') && key.length > 50 && key.length < 100)
return <MentionUser pubkey={key.replace('pub-', '')} />;
if (key.startsWith('tag')) return <Hashtag tag={key.replace('tag-', '')} />;