Prevent multiple clicks on post retry (#6055)
Этот коммит содержится в:
коммит произвёл
Corey Hulen
родитель
f961378600
Коммит
9b9788cf11
@@ -14,13 +14,23 @@ import React from 'react';
|
|||||||
export default class PendingPostOptions extends React.Component {
|
export default class PendingPostOptions extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
this.retryPost = this.retryPost.bind(this);
|
this.retryPost = this.retryPost.bind(this);
|
||||||
this.cancelPost = this.cancelPost.bind(this);
|
this.cancelPost = this.cancelPost.bind(this);
|
||||||
|
|
||||||
|
this.submitting = false;
|
||||||
|
|
||||||
this.state = {};
|
this.state = {};
|
||||||
}
|
}
|
||||||
retryPost(e) {
|
retryPost(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
if (this.submitting) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.submitting = true;
|
||||||
|
|
||||||
var post = this.props.post;
|
var post = this.props.post;
|
||||||
queuePost(post, true, null,
|
queuePost(post, true, null,
|
||||||
(err) => {
|
(err) => {
|
||||||
@@ -30,9 +40,7 @@ export default class PendingPostOptions extends React.Component {
|
|||||||
this.forceUpdate();
|
this.forceUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setState({
|
this.submitting = false;
|
||||||
submitting: false
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user