From 06f8f0b3a5d108d988b1e698e694c1dfe31dea9b Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Fri, 9 Apr 2021 23:10:12 -0400 Subject: [PATCH] MM-34714 fix mention highlight to dismiss mentions for non existent users (#5300) --- .../at_mention/__snapshots__/at_mention.test.js.snap | 9 +-------- app/components/at_mention/at_mention.js | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/app/components/at_mention/__snapshots__/at_mention.test.js.snap b/app/components/at_mention/__snapshots__/at_mention.test.js.snap index 6427acd72..934ece814 100644 --- a/app/components/at_mention/__snapshots__/at_mention.test.js.snap +++ b/app/components/at_mention/__snapshots__/at_mention.test.js.snap @@ -9,14 +9,7 @@ exports[`AtMention should match snapshot, no highlight 1`] = ` } > @John.Smith diff --git a/app/components/at_mention/at_mention.js b/app/components/at_mention/at_mention.js index 44ac90661..aa4be87ec 100644 --- a/app/components/at_mention/at_mention.js +++ b/app/components/at_mention/at_mention.js @@ -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; }