feat: simplify replying to badge in detailed view

zio/stable
patak 2022-12-29 21:09:54 +01:00
parent 55236dac98
commit 81869df4bd
2 changed files with 8 additions and 3 deletions

View File

@ -15,6 +15,9 @@ const props = withDefaults(
// Manual overrides // Manual overrides
hasOlder?: boolean hasOlder?: boolean
hasNewer?: 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 }, { actions: true, showReplyTo: true },
) )
@ -74,8 +77,10 @@ const showRebloggedByAvatarOnAvatar = $computed(() => rebloggedBy && avatarOnAva
// Collapse ReplyingTo badge if it is a self-reply (thread) // Collapse ReplyingTo badge if it is a self-reply (thread)
const collapseReplyingTo = $computed(() => (!rebloggedBy || collapseRebloggedBy) && status.inReplyToAccountId === status.account.id) const collapseReplyingTo = $computed(() => (!rebloggedBy || collapseRebloggedBy) && status.inReplyToAccountId === status.account.id)
// Only show avatar in ReplyingTo badge if it was reblogged by the same account // 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(() => rebloggedBy && rebloggedBy.id === status.inReplyToAccountId) const simplifyReplyingTo = $computed(() =>
(props.main && props.main.account.id === status.inReplyToAccountId) || (rebloggedBy && rebloggedBy.id === status.inReplyToAccountId),
)
const isDM = $computed(() => status.visibility === 'direct') const isDM = $computed(() => status.visibility === 'direct')
</script> </script>

View File

@ -86,7 +86,7 @@ onReactivated(() => {
<template v-for="(comment, di) of context?.descendants" :key="comment.id"> <template v-for="(comment, di) of context?.descendants" :key="comment.id">
<StatusCard <StatusCard
:status="comment" :actions="comment.visibility !== 'direct'" context="account" :status="comment" :actions="comment.visibility !== 'direct'" context="account"
:older="context?.descendants[di + 1]" :newer="context?.descendants[di - 1]" :has-newer="di === 0" :older="context?.descendants[di + 1]" :newer="context?.descendants[di - 1]" :has-newer="di === 0" :main="status"
/> />
</template> </template>