]> Untitled Git - lemmy.git/commitdiff
Adding disable vote buttons when not logged in. #416
authorDessalines <tyhou13@gmx.com>
Tue, 14 Jan 2020 15:38:45 +0000 (10:38 -0500)
committerDessalines <tyhou13@gmx.com>
Tue, 14 Jan 2020 15:38:45 +0000 (10:38 -0500)
ui/src/components/comment-node.tsx
ui/src/components/post-listing.tsx

index 2c15b6c8f881191a3c1506ed570173f2ad0a04b1..21a82954b297a7a728db107abc33a36959772058 100644 (file)
@@ -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'
                 }`}
index 5a528bbfc7f16e902d71048e232f31c5a0483058..ee28c6b43effb5a8714701e22e6fa409e4382329 100644 (file)
@@ -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'
               }`}