Fix bug where replying to grandparents re-orders thread (#8662)
* Fix bug where optimistic replies were inserted above the root post * Rename variables for clarity
This commit is contained in:
@@ -33,6 +33,12 @@ export function getRootPostAtUri(post: AppBskyFeedDefs.PostView) {
|
||||
AppBskyFeedPost.isRecord,
|
||||
)
|
||||
) {
|
||||
/**
|
||||
* If the record has no `reply` field, it is a root post.
|
||||
*/
|
||||
if (!post.record.reply) {
|
||||
return new AtUri(post.uri)
|
||||
}
|
||||
if (post.record.reply?.root?.uri) {
|
||||
return new AtUri(post.record.reply.root.uri)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user