mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-16 15:21:48 +03:00
Fix wrong account shown for multiple same-username links
This commit is contained in:
parent
306a96eec3
commit
ac07479edd
1 changed files with 8 additions and 6 deletions
|
@ -24,12 +24,14 @@ function handleContentLinks(opts) {
|
|||
).innerText.trim();
|
||||
const username = targetText.replace(/^@/, '');
|
||||
const url = target.getAttribute('href');
|
||||
const mention = mentions.find(
|
||||
(mention) =>
|
||||
mention.username === username ||
|
||||
mention.acct === username ||
|
||||
mention.url === url,
|
||||
);
|
||||
// Only fallback to acct/username check if url doesn't match
|
||||
const mention =
|
||||
mentions.find((mention) => mention.url === url) ||
|
||||
mentions.find(
|
||||
(mention) =>
|
||||
mention.acct === username || mention.username === username,
|
||||
);
|
||||
console.warn('MENTION', mention, url);
|
||||
if (mention) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
|
Loading…
Add table
Reference in a new issue