Update comments
This commit is contained in:
@@ -135,10 +135,10 @@ export function sortAndAnnotateThreadItems(
|
||||
} else if (AppBskyUnspeccedDefs.isThreadItemPost(item.value)) {
|
||||
if (parentMetadata) {
|
||||
/*
|
||||
* Set this value before incrementing the parent's repliesSeenCounter
|
||||
* Set this value before incrementing the `repliesIndexCounter`, since
|
||||
* `repliesIndexCounter` is 1-indexed and `replyIndex` is 0-indexed.
|
||||
*/
|
||||
metadata!.replyIndex = parentMetadata.repliesIndexCounter
|
||||
// Increment the parent's repliesIndexCounter
|
||||
parentMetadata.repliesIndexCounter += 1
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ export function sortAndAnnotateThreadItems(
|
||||
storeTraversalMetadata(metadatas, childMetadata)
|
||||
if (childParentMetadata) {
|
||||
/*
|
||||
* Set this value before incrementing the parent's
|
||||
* Set this value before incrementing the
|
||||
* `repliesIndexCounter`, since `repliesIndexCounter` is
|
||||
* 1-indexed and `replyIndex` is 0-indexed.
|
||||
*/
|
||||
|
||||
@@ -201,9 +201,9 @@ export type TraversalMetadata = {
|
||||
* After traversal, we can use this to calculate if we actually got all the
|
||||
* replies we expected, or if some were blocked, etc.
|
||||
*
|
||||
* Because this value is incremented startging from 0, it is 1-indexed. So to
|
||||
* when comparing to the `replyIndex`, you'll need to subtract 1 from this
|
||||
* value.
|
||||
* Note: this is a "counter", not an "index". Because this value is
|
||||
* incremented starting from 0, it is 1-indexed. So to when comparing to the
|
||||
* `replyIndex`, you'll need to subtract 1 from this value.
|
||||
*/
|
||||
repliesSeenCounter: number
|
||||
/**
|
||||
@@ -211,9 +211,9 @@ export type TraversalMetadata = {
|
||||
* for populating the `replyIndex` of the post by referencing this value on
|
||||
* the parent.
|
||||
*
|
||||
* Because this value is incremented startging from 0, it is 1-indexed. So to
|
||||
* when comparing to the `replyIndex`, you'll need to subtract 1 from this
|
||||
* value.
|
||||
* Note: this is a "counter", not an "index". Because this value is
|
||||
* incremented starting from 0, it is 1-indexed. So to when comparing to the
|
||||
* `replyIndex`, you'll need to subtract 1 from this value.
|
||||
*/
|
||||
repliesIndexCounter: number
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user