Skip to content

A platform for community discussion. Free, open, simple.

FIX: skip click-tracking for mentions

Penar Musarajb75720d9113e
diff --git a/app/assets/javascripts/discourse/lib/click-track.js.es6 b/app/assets/javascripts/discourse/lib/click-track.js.es6
index 94ff320c8db..6fcbfcb6788 100644
--- a/app/assets/javascripts/discourse/lib/click-track.js.es6
+++ b/app/assets/javascripts/discourse/lib/click-track.js.es6
@@ -6,15 +6,10 @@ import { selectedText } from "discourse/lib/utilities";
export function isValidLink($link) {
// Do not track:
// - lightboxes
- // - group mentions
// - links with disabled tracking
// - category links
// - quote back button
- if (
- $link.is(
- ".lightbox, .mention, .mention-group, .no-track-link, .hashtag, .back"
- )
- ) {
+ if ($link.is(".lightbox, .no-track-link, .hashtag, .back")) {
return false;
}
@@ -52,6 +47,11 @@ export default {
const $link = $(e.currentTarget);
const tracking = isValidLink($link);
+ // Return early for mentions and group mentions
+ if ($link.is(".mention, .mention-group")) {
+ return true;
+ }
+
if ($link.hasClass("attachment")) {
// Warn the user if they cannot download the file.
if (