FIX: Convert jQuery array to JS array

This commit is contained in:
Robin Ward 2020-09-02 11:11:04 -04:00
parent 5e5d5b4f35
commit 720cd57fb5
1 changed files with 7 additions and 5 deletions

View File

@ -64,11 +64,13 @@ function updateFound($mentions, usernames) {
export function linkSeenMentions($elem, siteSettings) {
const $mentions = $("span.mention:not(.mention-tested)", $elem);
if ($mentions.length) {
const usernames = $mentions.map((_, e) =>
$(e)
.text()
.substr(1)
);
const usernames = [
...$mentions.map((_, e) =>
$(e)
.text()
.substr(1)
)
];
updateFound($mentions, usernames);
return usernames
.uniq()