Skip to content

Commit

Permalink
Fix Reddit comment streams (#1698)
Browse files Browse the repository at this point in the history
  • Loading branch information
garrrikkotua authored Oct 16, 2023
1 parent 5e82450 commit b0f5c64
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ async function getMoreComments(
url: `http://oauth.reddit.com/api/morechildren?api_type=json`,
params: {
depth: 99,
link_id: input.postId,
link_id: `t3_${input.postId}`,
children: input.children,
},
headers: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,11 @@ const processMoreCommentStream: ProcessStreamHandler = async (ctx) => {
ctx,
)

const comments = response.json.data.things
const comments = response?.json?.data?.things

if (!comments) {
return
}

if (comments.length === 0) {
return
Expand Down

0 comments on commit b0f5c64

Please sign in to comment.