From a4fce6b082d16406e034a614862ced6093aac071 Mon Sep 17 00:00:00 2001 From: igoradamenko Date: Sat, 26 May 2018 16:26:44 +0300 Subject: [PATCH] remove requesting updated comment after voting --- web/app/components/comment/comment.jsx | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/web/app/components/comment/comment.jsx b/web/app/components/comment/comment.jsx index 97aaf800..a69b9c78 100644 --- a/web/app/components/comment/comment.jsx +++ b/web/app/components/comment/comment.jsx @@ -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) {