summaryrefslogtreecommitdiffstats
path: root/web/react/components/post_info.jsx
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2015-07-23 12:45:08 -0400
committerJoramWilander <jwawilander@gmail.com>2015-08-18 08:58:31 -0400
commit5596a6b37c440522176fdc05217161d7de7e169c (patch)
tree934ea924e0096d7d49621163c07da46ed67b68ac /web/react/components/post_info.jsx
parent32f7b50bb5c62d27def3f2e6d2839511c0b8f9a9 (diff)
downloadchat-5596a6b37c440522176fdc05217161d7de7e169c.tar.gz
chat-5596a6b37c440522176fdc05217161d7de7e169c.tar.bz2
chat-5596a6b37c440522176fdc05217161d7de7e169c.zip
added client predictive commenting
Diffstat (limited to 'web/react/components/post_info.jsx')
-rw-r--r--web/react/components/post_info.jsx7
1 files changed, 5 insertions, 2 deletions
diff --git a/web/react/components/post_info.jsx b/web/react/components/post_info.jsx
index 8eaaf4e8c..93d028e18 100644
--- a/web/react/components/post_info.jsx
+++ b/web/react/components/post_info.jsx
@@ -22,16 +22,19 @@ module.exports = React.createClass({
var comments = "";
var lastCommentClass = this.props.isLastComment ? " comment-icon__container__show" : " comment-icon__container__hide";
- if (this.props.commentCount >= 1) {
+ if (this.props.commentCount >= 1 && !post.did_fail && !post.is_loading) {
comments = <a href="#" className={"comment-icon__container theme" + lastCommentClass} onClick={this.props.handleCommentClick}><span className="comment-icon" dangerouslySetInnerHTML={{__html: Constants.COMMENT_ICON }} />{this.props.commentCount}</a>;
}
+ var show_dropdown = isOwner || (this.props.allowReply === "true" && type != "Comment");
+ if (post.did_fail || post.is_loading) show_dropdown = false;
+
return (
<ul className="post-header post-info">
<li className="post-header-col"><time className="post-profile-time">{ utils.displayDateTime(post.create_at) }</time></li>
<li className="post-header-col post-header__reply">
<div className="dropdown">
- { isOwner || (this.props.allowReply === "true" && type != "Comment") ?
+ { show_dropdown ?
<div>
<a href="#" className="dropdown-toggle theme" type="button" data-toggle="dropdown" aria-expanded="false" />
<ul className="dropdown-menu" role="menu">