Bluesky app fork with some witchin' additions 💫

Fix isPartOfLastBranchFromDepth assignment (#8856)

authored by

Eric Bailey and committed by
GitHub
ea7f984a 49237869

+11 -4
+9 -2
src/state/queries/usePostThread/traversal.ts
··· 307 307 metadata.isPartOfLastBranchFromDepth = metadata.depth 308 308 309 309 /** 310 - * If the parent is part of the last branch of the sub-tree, so is the child. 310 + * If the parent is part of the last branch of the sub-tree, so 311 + * is the child. However, if the child is also a last sibling, 312 + * then we need to start tracking `isPartOfLastBranchFromDepth` 313 + * from this point onwards, always updating it to the depth of 314 + * the last sibling as we go down. 311 315 */ 312 - if (metadata.parentMetadata.isPartOfLastBranchFromDepth) { 316 + if ( 317 + !metadata.isLastSibling && 318 + metadata.parentMetadata.isPartOfLastBranchFromDepth 319 + ) { 313 320 metadata.isPartOfLastBranchFromDepth = 314 321 metadata.parentMetadata.isPartOfLastBranchFromDepth 315 322 }
+2 -2
src/state/queries/usePostThread/types.ts
··· 151 151 */ 152 152 isLastChild: boolean 153 153 /** 154 - * Indicates if the post is the left/lower-most branch of the reply tree. 155 - * Value corresponds to the depth at which this branch started. 154 + * Indicates if the post is the left-most AND lower-most branch of the reply 155 + * tree. Value corresponds to the depth at which this branch started. 156 156 */ 157 157 isPartOfLastBranchFromDepth?: number 158 158 /**