forked from Mirrors/elk
refactor: check last children
This commit is contained in:
parent
9bdfd71b0a
commit
9f85275791
1 changed files with 2 additions and 2 deletions
|
@ -24,8 +24,8 @@ const vnode = $computed(() => {
|
||||||
|
|
||||||
// remove link at the end of content if matches preview card URL
|
// remove link at the end of content if matches preview card URL
|
||||||
const previewCardURL = (status as mastodon.v1.Status).card?.url
|
const previewCardURL = (status as mastodon.v1.Status).card?.url
|
||||||
if (vnode?.children !== null) {
|
if (vnode?.children) {
|
||||||
const contentChildren = vnode?.children[0].children
|
const contentChildren = vnode?.children[vnode?.children.length - 1].children
|
||||||
const contentLastChild = contentChildren[contentChildren.length - 1]
|
const contentLastChild = contentChildren[contentChildren.length - 1]
|
||||||
const matchesPreviewURL = contentLastChild.type === 'a' && contentLastChild.props?.href === previewCardURL
|
const matchesPreviewURL = contentLastChild.type === 'a' && contentLastChild.props?.href === previewCardURL
|
||||||
if (matchesPreviewURL)
|
if (matchesPreviewURL)
|
||||||
|
|
Loading…
Reference in a new issue