diff options
author | Joram Wilander <jwawilander@gmail.com> | 2017-04-12 17:25:00 -0400 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2017-04-12 14:25:00 -0700 |
commit | 9b9788cf110b57a080d4a4dae43c7deff0274710 (patch) | |
tree | 82f10d9f8d542e6b9843902df7c9ffc4e7351839 /webapp/components | |
parent | f961378600b661a35adaae181bb6b2c12d0ae3cf (diff) | |
download | chat-9b9788cf110b57a080d4a4dae43c7deff0274710.tar.gz chat-9b9788cf110b57a080d4a4dae43c7deff0274710.tar.bz2 chat-9b9788cf110b57a080d4a4dae43c7deff0274710.zip |
Prevent multiple clicks on post retry (#6055)
Diffstat (limited to 'webapp/components')
-rw-r--r-- | webapp/components/post_view/components/pending_post_options.jsx | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/webapp/components/post_view/components/pending_post_options.jsx b/webapp/components/post_view/components/pending_post_options.jsx index c44686ffc..0085a16f2 100644 --- a/webapp/components/post_view/components/pending_post_options.jsx +++ b/webapp/components/post_view/components/pending_post_options.jsx @@ -14,13 +14,23 @@ import React from 'react'; export default class PendingPostOptions extends React.Component { constructor(props) { super(props); + this.retryPost = this.retryPost.bind(this); this.cancelPost = this.cancelPost.bind(this); + + this.submitting = false; + this.state = {}; } retryPost(e) { e.preventDefault(); + if (this.submitting) { + return; + } + + this.submitting = true; + var post = this.props.post; queuePost(post, true, null, (err) => { @@ -30,9 +40,7 @@ export default class PendingPostOptions extends React.Component { this.forceUpdate(); } - this.setState({ - submitting: false - }); + this.submitting = false; } ); |