Skip to content

Commit

Permalink
fix: image post errors
Browse files Browse the repository at this point in the history
  • Loading branch information
KodingDev committed Nov 19, 2022
1 parent 5dc37d9 commit ee666b4
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/util/tiktok.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,15 @@ class TikTokAPI extends APIClient {
likes: details.statistics?.digg_count ?? 0,
comments: details.statistics?.comment_count ?? 0,
},
imagePost: {
images:
details.image_post_info?.images.map((image) => ({
url: image.display_image.url_list[0],
width: image.display_image.width,
height: image.display_image.height,
})) ?? [],
},
imagePost: details.image_post_info
? {
images: details.image_post_info.images.map((image) => ({
url: image.display_image.url_list[0],
width: image.display_image.width,
height: image.display_image.height,
})),
}
: undefined,
src: {
type: "internal",
data: details,
Expand Down

0 comments on commit ee666b4

Please sign in to comment.