From 1d88dff11750ae9aa376e94fa649f623fa19fae6 Mon Sep 17 00:00:00 2001 From: dangered wolf Date: Thu, 24 Oct 2024 11:38:21 -0700 Subject: [PATCH] Update typing --- src/providers/bsky/conversation.ts | 3 +++ src/types/vendor/bsky.d.ts | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/providers/bsky/conversation.ts b/src/providers/bsky/conversation.ts index 4173d94e..c1ead44c 100644 --- a/src/providers/bsky/conversation.ts +++ b/src/providers/bsky/conversation.ts @@ -34,6 +34,9 @@ export const fetchBskyThread = async (post: string, author: string, processThrea }; const followReplyChain = (thread: BlueskyThread): BlueskyPost[] => { + if (!thread.replies) + return []; + for (const _post of thread.replies) { const post = _post.post; if (post.author.did !== thread.post.author.did) { diff --git a/src/types/vendor/bsky.d.ts b/src/types/vendor/bsky.d.ts index 757c4bf2..0f594723 100644 --- a/src/types/vendor/bsky.d.ts +++ b/src/types/vendor/bsky.d.ts @@ -108,7 +108,7 @@ type BlueskyRecord = { type BlueskyThread = { parent: BlueskyThread; post: BlueskyPost; - replies: BlueskyThread[]; + replies?: BlueskyThread[]; }; type BlueskyThreadResponse = {