mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-03-14 12:18:30 +03:00
Prevent showing card and QP for links that link the post itself
Use case: links from lemmy
This commit is contained in:
parent
91a7485b7b
commit
166f9da232
1 changed files with 9 additions and 1 deletions
|
@ -965,7 +965,12 @@ function Status({
|
|||
'a[href]:not(.u-url):not(.mention):not(.hashtag)',
|
||||
),
|
||||
)
|
||||
.filter((a) => isMastodonLinkMaybe(a.href))
|
||||
.filter((a) => {
|
||||
const url = a.href;
|
||||
const isPostItself =
|
||||
url === status.url || url === status.uri;
|
||||
return !isPostItself && isMastodonLinkMaybe(url);
|
||||
})
|
||||
.forEach((a, i) => {
|
||||
unfurlMastodonLink(currentInstance, a.href).then(
|
||||
(result) => {
|
||||
|
@ -1076,6 +1081,9 @@ function Status({
|
|||
</div>
|
||||
)}
|
||||
{!!card &&
|
||||
card?.url !== status.url &&
|
||||
card?.url !== status.uri &&
|
||||
/^https/i.test(card?.url) &&
|
||||
!sensitive &&
|
||||
!spoilerText &&
|
||||
!poll &&
|
||||
|
|
Loading…
Add table
Reference in a new issue