planning for edge cases

This commit is contained in:
2022-01-28 08:34:59 -06:00
parent 0dfa2d10c9
commit cbef00d541

View File

@@ -81,6 +81,8 @@ export default function Feed() {
let sortedPosts = extractedPosts.sort(comparePosts); // implements sorting function
console.log(sortedPosts);
let newFeed = sortedPosts.map((post) => {
return (
<Post
@@ -91,10 +93,10 @@ export default function Feed() {
comments={post.data.num_comments}
time={post.data.created_utc}
key={v4()}
media={post.data.post_hint === 'image' && post.url}
media={post.data.post_hint === 'image' && post.data.url}
permalink={post.data.permalink}
selftext={post.data.selftext}
video={post.data.is_video ? post.data.media.reddit_video.fallback_url : null}
video={post.data.is_video ? post.data.media.reddit_video.fallback_url : null} // to do: handle media edge cases, especially video
/>
);
})