From 81869df4bd1fd9cca4e0198f4ddd04df2aa92aa6 Mon Sep 17 00:00:00 2001 From: patak Date: Thu, 29 Dec 2022 21:09:54 +0100 Subject: [PATCH] feat: simplify replying to badge in detailed view --- components/status/StatusCard.vue | 9 +++++++-- pages/[[server]]/@[account]/[status].vue | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/components/status/StatusCard.vue b/components/status/StatusCard.vue index 08bad62f..54022d53 100644 --- a/components/status/StatusCard.vue +++ b/components/status/StatusCard.vue @@ -15,6 +15,9 @@ const props = withDefaults( // Manual overrides hasOlder?: boolean hasNewer?: boolean + // When looking into a detailed view of a post, we can simplify the replying badges + // to the main expanded post + main?: Status }>(), { actions: true, showReplyTo: true }, ) @@ -74,8 +77,10 @@ const showRebloggedByAvatarOnAvatar = $computed(() => rebloggedBy && avatarOnAva // Collapse ReplyingTo badge if it is a self-reply (thread) const collapseReplyingTo = $computed(() => (!rebloggedBy || collapseRebloggedBy) && status.inReplyToAccountId === status.account.id) -// Only show avatar in ReplyingTo badge if it was reblogged by the same account -const simplifyReplyingTo = $computed(() => rebloggedBy && rebloggedBy.id === status.inReplyToAccountId) +// Only show avatar in ReplyingTo badge if it was reblogged by the same account or if it is against the main post +const simplifyReplyingTo = $computed(() => + (props.main && props.main.account.id === status.inReplyToAccountId) || (rebloggedBy && rebloggedBy.id === status.inReplyToAccountId), +) const isDM = $computed(() => status.visibility === 'direct') diff --git a/pages/[[server]]/@[account]/[status].vue b/pages/[[server]]/@[account]/[status].vue index d883303e..8779cb01 100644 --- a/pages/[[server]]/@[account]/[status].vue +++ b/pages/[[server]]/@[account]/[status].vue @@ -86,7 +86,7 @@ onReactivated(() => {