summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2020-01-14 10:38:45 -0500
committerDessalines <tyhou13@gmx.com>2020-01-14 10:38:45 -0500
commit03bbfc55a73f8680447cc41e8d3f13f66236dec9 (patch)
tree9d9334246fc8fd7058ff2c10ccd16d7586bbeb40 /ui
parenteccd8260888dbd5cdc910d115586a6659ed97455 (diff)
Adding disable vote buttons when not logged in. #416
Diffstat (limited to 'ui')
-rw-r--r--ui/src/components/comment-node.tsx2
-rw-r--r--ui/src/components/post-listing.tsx2
2 files changed, 4 insertions, 0 deletions
diff --git a/ui/src/components/comment-node.tsx b/ui/src/components/comment-node.tsx
index 2c15b6c8..21a82954 100644
--- a/ui/src/components/comment-node.tsx
+++ b/ui/src/components/comment-node.tsx
@@ -105,6 +105,7 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
.viewOnly && 'no-click'}`}
>
<button
+ disabled={!UserService.Instance.user}
className={`btn p-0 ${
this.state.my_vote == 1 ? 'text-info' : 'text-muted'
}`}
@@ -117,6 +118,7 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
<div class={`font-weight-bold text-muted`}>{this.state.score}</div>
{WebSocketService.Instance.site.enable_downvotes && (
<button
+ disabled={!UserService.Instance.user}
className={`btn p-0 ${
this.state.my_vote == -1 ? 'text-danger' : 'text-muted'
}`}
diff --git a/ui/src/components/post-listing.tsx b/ui/src/components/post-listing.tsx
index 5a528bbf..ee28c6b4 100644
--- a/ui/src/components/post-listing.tsx
+++ b/ui/src/components/post-listing.tsx
@@ -111,6 +111,7 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
.viewOnly && 'no-click'}`}
>
<button
+ disabled={!UserService.Instance.user}
className={`btn p-0 ${
this.state.my_vote == 1 ? 'text-info' : 'text-muted'
}`}
@@ -123,6 +124,7 @@ export class PostListing extends Component<PostListingProps, PostListingState> {
<div class={`font-weight-bold text-muted`}>{this.state.score}</div>
{WebSocketService.Instance.site.enable_downvotes && (
<button
+ disabled={!UserService.Instance.user}
className={`btn p-0 ${
this.state.my_vote == -1 ? 'text-danger' : 'text-muted'
}`}