fix: display error message when user or channel does not exists

This commit is contained in:
Lukian LEIZOUR 2025-04-18 18:39:56 +02:00
parent 17c6ab79ca
commit 2b2a38682a
5 changed files with 80 additions and 33 deletions

View file

@ -21,10 +21,10 @@ export default function MessageComponent({ message, user, channel, deleteMessage
if (word.startsWith("@")) {
const mention = message.mentions.find((mention) => `@${mention.username}` === word);
if (mention) {
return <span><Link key={index} to={`/u/${mention.username}`}>{word}</Link> </span>;
return <span key={index} ><Link to={`/u/${mention.username}`}>{word}</Link> </span>;
}
} else if (word.startsWith("https://") || word.startsWith("http://")) {
return <span><Link to={word}>{word}</Link> </span>
return <span key={index} ><Link to={word}>{word}</Link> </span>
}
return <span key={index}>{word} </span>;
})}