MM-34714 fix mention highlight to dismiss mentions for non existent users (#5300)
This commit is contained in:
parent
c22e93ddb0
commit
06f8f0b3a5
2 changed files with 2 additions and 9 deletions
|
|
@ -9,14 +9,7 @@ exports[`AtMention should match snapshot, no highlight 1`] = `
|
|||
}
|
||||
>
|
||||
<Text
|
||||
style={
|
||||
Array [
|
||||
Object {
|
||||
"backgroundColor": "#ffe577",
|
||||
"color": "#145dbf",
|
||||
},
|
||||
]
|
||||
}
|
||||
style={Array []}
|
||||
>
|
||||
@John.Smith
|
||||
</Text>
|
||||
|
|
|
|||
|
|
@ -174,12 +174,12 @@ export default class AtMention extends React.PureComponent {
|
|||
} else {
|
||||
const pattern = new RegExp(/\b(all|channel|here)(?:\.\B|_\b|\b)/, 'i');
|
||||
const mentionMatch = pattern.exec(mentionName);
|
||||
highlighted = true;
|
||||
|
||||
if (mentionMatch) {
|
||||
mention = mentionMatch.length > 1 ? mentionMatch[1] : mentionMatch[0];
|
||||
suffix = mentionName.replace(mention, '');
|
||||
isMention = true;
|
||||
highlighted = true;
|
||||
} else {
|
||||
mention = mentionName;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue