Update visibility logic in ThreadedPost component
- Refined the visibility logic to ensure a post is only hidden if its parent is collapsed, rather than if it is collapsed itself. This change enhances the clarity of post visibility in threaded discussions. - Adjusted the parent-collapsed prop to reflect the current collapse state, improving the interaction and user experience within the NostrFeed module.
This commit is contained in:
parent
f0a6b2bd1d
commit
4e90a4e795
1 changed files with 3 additions and 2 deletions
|
|
@ -41,7 +41,8 @@ const isCollapsed = computed(() => props.collapsedPosts?.has(props.post.id) || f
|
||||||
const hasLimitedReplies = computed(() => props.limitedReplyPosts?.has(props.post.id) || false)
|
const hasLimitedReplies = computed(() => props.limitedReplyPosts?.has(props.post.id) || false)
|
||||||
|
|
||||||
// Check if this post should be visible (not hidden by parent collapse)
|
// Check if this post should be visible (not hidden by parent collapse)
|
||||||
const isVisible = computed(() => !props.parentCollapsed && !isCollapsed.value)
|
// Note: A post is only hidden if its PARENT is collapsed, not if IT is collapsed
|
||||||
|
const isVisible = computed(() => !props.parentCollapsed)
|
||||||
|
|
||||||
// Check if this is an admin post
|
// Check if this is an admin post
|
||||||
const isAdminPost = computed(() => props.adminPubkeys.includes(props.post.pubkey))
|
const isAdminPost = computed(() => props.adminPubkeys.includes(props.post.pubkey))
|
||||||
|
|
@ -252,7 +253,7 @@ function getRideshareType(post: FeedPost): string {
|
||||||
:get-display-name="getDisplayName"
|
:get-display-name="getDisplayName"
|
||||||
:get-event-reactions="getEventReactions"
|
:get-event-reactions="getEventReactions"
|
||||||
:depth="depth + 1"
|
:depth="depth + 1"
|
||||||
:parent-collapsed="false"
|
:parent-collapsed="isCollapsed"
|
||||||
:collapsed-posts="collapsedPosts"
|
:collapsed-posts="collapsedPosts"
|
||||||
:limited-reply-posts="limitedReplyPosts"
|
:limited-reply-posts="limitedReplyPosts"
|
||||||
@reply-to-note="$emit('reply-to-note', $event)"
|
@reply-to-note="$emit('reply-to-note', $event)"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue