Update naming
This commit is contained in:
@@ -145,7 +145,7 @@ export function traverse(
|
||||
/*
|
||||
* Set this value before incrementing the parent's repliesSeenCount
|
||||
*/
|
||||
metadata!.repliesIndex = parentMetadata.repliesIndexCount
|
||||
metadata!.replyIndex = parentMetadata.repliesIndexCount
|
||||
// Increment the parent's repliesIndexCount
|
||||
parentMetadata.repliesIndexCount += 1
|
||||
}
|
||||
@@ -211,7 +211,7 @@ export function traverse(
|
||||
/*
|
||||
* Set this value before incrementing the parent's repliesIndexCount
|
||||
*/
|
||||
childMetadata!.repliesIndex =
|
||||
childMetadata!.replyIndex =
|
||||
childParentMetadata.repliesIndexCount
|
||||
childParentMetadata.repliesIndexCount += 1
|
||||
}
|
||||
@@ -328,8 +328,7 @@ export function traverse(
|
||||
* based on the actual data that we've seen.
|
||||
*/
|
||||
metadata.isLastSibling =
|
||||
metadata.repliesIndex ===
|
||||
metadata.parentMetadata.repliesSeenCount - 1
|
||||
metadata.replyIndex === metadata.parentMetadata.repliesSeenCount - 1
|
||||
metadata.isLastChild =
|
||||
metadata.nextItemDepth === undefined ||
|
||||
metadata.nextItemDepth <= metadata.depth
|
||||
|
||||
@@ -161,14 +161,14 @@ export type TraversalMetadata = {
|
||||
repliesSeenCount: number
|
||||
/**
|
||||
* The total number of replies to this post hydrated in this response. Used
|
||||
* for populating the `repliesIndex` of the post by referencing this value on
|
||||
* for populating the `replyIndex` of the post by referencing this value on
|
||||
* the parent.
|
||||
*/
|
||||
repliesIndexCount: number
|
||||
/**
|
||||
* The index-0-based index of this reply in the parent post's replies.
|
||||
*/
|
||||
repliesIndex: number
|
||||
replyIndex: number
|
||||
/**
|
||||
* Each slice is responsible for rendering reply lines based on its depth.
|
||||
* This value corresponds to any line indices that can be skipped e.g.
|
||||
|
||||
@@ -87,7 +87,7 @@ export function getTraversalMetadata({
|
||||
repliesUnhydrated,
|
||||
repliesSeenCount: 0,
|
||||
repliesIndexCount: 0,
|
||||
repliesIndex: 0,
|
||||
replyIndex: 0,
|
||||
skippedIndentIndices: new Set<number>(),
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user