From 09b5e8f0bdb9ecb14b780f743b0f43ab6ee84c99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20HORTA?= <4470714+Frazew@users.noreply.github.com> Date: Sun, 17 Nov 2024 12:25:54 +0100 Subject: [PATCH] fix(bluesky): properly set root post on replies Chained replies (threads) keep track of the root post to properly display the thread. When adding a new reply to a post, it's therefore necessary to check first if that post was itself a reply: if it is, we simply copy its root post reference --- src/services/bluesky-sender.service.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/services/bluesky-sender.service.ts b/src/services/bluesky-sender.service.ts index e8359b6..ccfeea3 100644 --- a/src/services/bluesky-sender.service.ts +++ b/src/services/bluesky-sender.service.ts @@ -219,7 +219,14 @@ export const blueskySenderService = async ( if (chunkIndex === 0) { if (post.replyPost) { - data.reply = buildReplyEntry(post.replyPost); + if (post.replyPost.value.reply) { + data.reply = buildReplyEntry( + post.replyPost.value.reply.root, + post.replyPost, + ); + } else { + data.reply = buildReplyEntry(post.replyPost); + } } } else { data.reply = buildReplyEntry(