fix empty source links.

master
Jason Schwarzenberger 4 years ago
parent a86eb98c1a
commit a2e5faa3b5
  1. 9
      webclient/src/utils.js

@ -16,12 +16,11 @@ export const sourceLink = (story) => {
export const infoLine = (story) => (
<div className="info">
{story.score} points by <a href={story.author_link}>{story.author}</a>
&#8203; {moment.unix(story.date).fromNow()}
&#8203; on <a href={story.link}>{story.source}</a> | &#8203;
<Link
&#8203; {moment.unix(story.date).fromNow()}
&#8203; on {story.link ? <a href={story.link}>{story.source}</a> : story.source}
| &#8203; <Link
className={story.num_comments > 99 ? "hot" : ""}
to={"/" + story.id + "/c"}
>
to={"/" + story.id + "/c"}>
{story.num_comments} comment{story.num_comments !== 1 && "s"}
</Link>
</div>

Loading…
Cancel
Save