Skip to content

Commit

Permalink
MM-34714 fix mention highlight to dismiss mentions for non existent u…
Browse files Browse the repository at this point in the history
…sers (mattermost#5300)
  • Loading branch information
enahum authored Apr 10, 2021
1 parent c22e93d commit 06f8f0b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion app/components/at_mention/at_mention.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 06f8f0b

Please sign in to comment.