avoid intl error on date not defined in PostsItem base component (happen on pending view)

This commit is contained in:
xavizalote 2016-07-07 11:19:01 +02:00
parent 475e3cb370
commit 448a6464d7
2 changed files with 2 additions and 1 deletions

View file

@ -62,7 +62,7 @@ class PostsItem extends Component {
<div className="posts-item-meta">
{post.user? <div className="posts-item-user"><Telescope.components.UsersAvatar user={post.user} size="small"/><Telescope.components.UsersName user={post.user}/></div> : null}
<div className="posts-item-date"><FormattedRelative value={post.postedAt}/></div>
<div className="posts-item-date">{post.postedAt ? <FormattedRelative value={post.postedAt}/> : <FormattedMessage id="posts.dateNotDefined"/>}</div>
<div className="posts-item-comments">
<Link to={Posts.getPageUrl(post)}>
<FormattedMessage id="comments.count" values={{count: post.commentCount}}/>

View file

@ -30,6 +30,7 @@ Telescope.strings.en = {
"posts.created_message": "Post created.",
"posts.rate_limit_error": "Please wait {details} seconds before posting again.",
"posts.postedAt": "Posted at",
"posts.dateNotDefined": "Date not defined",
"comments.comments": "Comments",
"comments.count": "{count, plural, =0 {No comments} one {# comment} other {# comments}}",