remove requesting updated comment after voting

This commit is contained in:
igoradamenko
2018-05-26 16:26:44 +03:00
parent 770d60ead6
commit a4fce6b082
+2 -14
View File
@@ -199,13 +199,7 @@ export default class Comment extends Component {
score: score + 1,
});
this.votingPromise = this.votingPromise
.then(() => {
return api.vote({ id, url, value: 1 })
.then(() => {
api.getComment({ id }).then(comment => store.replaceComment(comment));
});
});
this.votingPromise = this.votingPromise.then(() => api.vote({ id, url, value: 1 }));
}
decreaseScore() {
@@ -220,13 +214,7 @@ export default class Comment extends Component {
score: score - 1,
});
this.votingPromise = this.votingPromise
.then(() => {
return api.vote({ id, url, value: -1 })
.then(() => {
api.getComment({ id }).then(comment => store.replaceComment(comment));
});
});
this.votingPromise = this.votingPromise.then(() => api.vote({ id, url, value: -1 }));
}
onReply(...rest) {