planning for edge cases
This commit is contained in:
@@ -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
|
||||
/>
|
||||
);
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user