FIX: skip click-tracking for mentions

This commit is contained in:
Penar Musaraj 2019-04-29 12:05:47 -04:00
parent 876c4f20b3
commit b75720d911
1 changed files with 6 additions and 6 deletions

View File

@ -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 (