diff options
author | Dessalines <tyhou13@gmx.com> | 2020-01-25 13:39:22 -0500 |
---|---|---|
committer | Dessalines <tyhou13@gmx.com> | 2020-01-25 13:39:22 -0500 |
commit | f4ecb53342254c40de4695480c4ae6f102ad760a (patch) | |
tree | d3679a8d49d91897130f7dc3c9b1d4483c7704e4 /ui/src/components/comment-node.tsx | |
parent | 1da94464eb57cf8a22e48301c59713d2aa2da3b9 (diff) |
Removing disabled from comment and post upvoting, showing toast now. Fixes #450
Diffstat (limited to 'ui/src/components/comment-node.tsx')
-rw-r--r-- | ui/src/components/comment-node.tsx | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/ui/src/components/comment-node.tsx b/ui/src/components/comment-node.tsx index 046fc88d..a42d096e 100644 --- a/ui/src/components/comment-node.tsx +++ b/ui/src/components/comment-node.tsx @@ -117,7 +117,6 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> { .viewOnly && 'no-click'}`} > <button - disabled={!UserService.Instance.user} className={`btn p-0 ${ node.comment.my_vote == 1 ? 'text-info' : 'text-muted' }`} @@ -138,7 +137,6 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> { </div> {WebSocketService.Instance.site.enable_downvotes && ( <button - disabled={!UserService.Instance.user} className={`btn p-0 ${ node.comment.my_vote == -1 ? 'text-danger' : 'text-muted' }`} @@ -761,9 +759,11 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> { } handleCommentUpvote(i: CommentNodeI) { - this.setState({ - upvoteLoading: true, - }); + if (UserService.Instance.user) { + this.setState({ + upvoteLoading: true, + }); + } let form: CommentLikeForm = { comment_id: i.comment.id, post_id: i.comment.post_id, @@ -773,9 +773,11 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> { } handleCommentDownvote(i: CommentNodeI) { - this.setState({ - downvoteLoading: true, - }); + if (UserService.Instance.user) { + this.setState({ + downvoteLoading: true, + }); + } let form: CommentLikeForm = { comment_id: i.comment.id, post_id: i.comment.post_id, |