diff --git a/src/state/queries/usePostThread/traversal.ts b/src/state/queries/usePostThread/traversal.ts index d407e0f93d..93adccae44 100644 --- a/src/state/queries/usePostThread/traversal.ts +++ b/src/state/queries/usePostThread/traversal.ts @@ -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 diff --git a/src/state/queries/usePostThread/types.ts b/src/state/queries/usePostThread/types.ts index 0809f10516..b4ed439a96 100644 --- a/src/state/queries/usePostThread/types.ts +++ b/src/state/queries/usePostThread/types.ts @@ -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. diff --git a/src/state/queries/usePostThread/utils.ts b/src/state/queries/usePostThread/utils.ts index 704aefbf67..eaea6a5993 100644 --- a/src/state/queries/usePostThread/utils.ts +++ b/src/state/queries/usePostThread/utils.ts @@ -87,7 +87,7 @@ export function getTraversalMetadata({ repliesUnhydrated, repliesSeenCount: 0, repliesIndexCount: 0, - repliesIndex: 0, + replyIndex: 0, skippedIndentIndices: new Set(), }