Skip to content
This repository has been archived by the owner on Jan 19, 2025. It is now read-only.

Commit

Permalink
fix(bluesky): properly set root post on replies
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Frazew authored and louisgrasset committed Dec 20, 2024
1 parent b08e7b5 commit 10dfac4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/services/bluesky-sender.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 10dfac4

Please sign in to comment.