From 9f852757919192cbe07d4204f9bcb81bbff3ec61 Mon Sep 17 00:00:00 2001 From: Ayo Date: Wed, 11 Jan 2023 18:57:22 +0100 Subject: [PATCH] refactor: check last children --- components/status/StatusBody.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/status/StatusBody.vue b/components/status/StatusBody.vue index a4f10821..46b2e0c5 100644 --- a/components/status/StatusBody.vue +++ b/components/status/StatusBody.vue @@ -24,8 +24,8 @@ const vnode = $computed(() => { // remove link at the end of content if matches preview card URL const previewCardURL = (status as mastodon.v1.Status).card?.url -if (vnode?.children !== null) { - const contentChildren = vnode?.children[0].children +if (vnode?.children) { + const contentChildren = vnode?.children[vnode?.children.length - 1].children const contentLastChild = contentChildren[contentChildren.length - 1] const matchesPreviewURL = contentLastChild.type === 'a' && contentLastChild.props?.href === previewCardURL if (matchesPreviewURL)