mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-25 09:18:51 +01: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();
|
).innerText.trim();
|
||||||
const username = targetText.replace(/^@/, '');
|
const username = targetText.replace(/^@/, '');
|
||||||
const url = target.getAttribute('href');
|
const url = target.getAttribute('href');
|
||||||
const mention = mentions.find(
|
// Only fallback to acct/username check if url doesn't match
|
||||||
(mention) =>
|
const mention =
|
||||||
mention.username === username ||
|
mentions.find((mention) => mention.url === url) ||
|
||||||
mention.acct === username ||
|
mentions.find(
|
||||||
mention.url === url,
|
(mention) =>
|
||||||
);
|
mention.acct === username || mention.username === username,
|
||||||
|
);
|
||||||
|
console.warn('MENTION', mention, url);
|
||||||
if (mention) {
|
if (mention) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|
Loading…
Reference in a new issue