fix some errors cause app crash

This commit is contained in:
Ren Amamiya
2023-08-19 08:56:19 +07:00
parent c85502e427
commit eda18f8c34
14 changed files with 265 additions and 253 deletions

View File

@@ -29,8 +29,9 @@ export function NoteContent({ content, long }: { content: RichContent; long?: bo
components={{
del: ({ children }) => {
const key = children[0] as string;
if (key.startsWith('pub')) return <MentionUser pubkey={key.slice(3)} />;
if (key.startsWith('tag')) return <Hashtag tag={key.slice(3)} />;
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-', '')} />;
},
}}
>