From: Dessalines Date: Tue, 14 Jan 2020 03:57:32 +0000 (-0500) Subject: Add fast comment and post voting. (Doesn't wait for server return) X-Git-Url: http://these/git/%7B%60/feeds/%24%7BgetStaticDir%28%29%7D/styles/static/%7BpictrsAvatarThumbnail%28user.avatar%29%7D?a=commitdiff_plain;h=f31c7816938808e3bab133d1cb7d842fef2e4c8e;p=lemmy.git Add fast comment and post voting. (Doesn't wait for server return) - Fixes #416 --- diff --git a/ui/src/components/comment-node.tsx b/ui/src/components/comment-node.tsx index 4d216f97..2c15b6c8 100644 --- a/ui/src/components/comment-node.tsx +++ b/ui/src/components/comment-node.tsx @@ -47,6 +47,8 @@ interface CommentNodeState { showConfirmAppointAsAdmin: boolean; collapsed: boolean; viewSource: boolean; + my_vote: number; + score: number; } interface CommentNodeProps { @@ -76,6 +78,8 @@ export class CommentNode extends Component { showConfirmTransferCommunity: false, showConfirmAppointAsMod: false, showConfirmAppointAsAdmin: false, + my_vote: this.props.node.comment.my_vote, + score: this.props.node.comment.score, }; constructor(props: any, context: any) { @@ -102,7 +106,7 @@ export class CommentNode extends Component { > -
- {node.comment.score} -
+
{this.state.score}
{WebSocketService.Instance.site.enable_downvotes && ( -
{post.score}
+
{this.state.score}
{WebSocketService.Instance.site.enable_downvotes && (