generated from lucien/api-template
fix: display error message when user or channel does not exists
This commit is contained in:
parent
17c6ab79ca
commit
2b2a38682a
5 changed files with 80 additions and 33 deletions
|
@ -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>;
|
||||
})}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue