Update.
This commit is contained in:
parent
586c653e4f
commit
0c6da9845c
@ -217,8 +217,10 @@ class ChatInputComponent extends NjetComponent {
|
||||
const matches = this.matchMentionsToAuthors(mentions, authors);
|
||||
let updatedText = text;
|
||||
matches.forEach(({ mention, closestAuthor }) => {
|
||||
const mentionRegex = new RegExp(`@${mention}`, 'g');
|
||||
updatedText = updatedText.replace(mentionRegex, `@${closestAuthor}`);
|
||||
if(closestAuthor){
|
||||
const mentionRegex = new RegExp(`@${mention}`, 'g');
|
||||
updatedText = updatedText.replace(mentionRegex, `@${closestAuthor}`);
|
||||
}
|
||||
});
|
||||
|
||||
return updatedText;
|
||||
|
Loading…
Reference in New Issue
Block a user