summaryrefslogtreecommitdiffstats
path: root/ui/src/components/post.tsx
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2020-01-20 10:11:50 -0500
committerDessalines <tyhou13@gmx.com>2020-01-20 10:11:50 -0500
commite31090c9bd2ac2c1a411026add0a3e36631cf8cd (patch)
tree8b28501446288f0c15463c41de6c819364d88381 /ui/src/components/post.tsx
parentf020e89a8c8b5a8dafc41cf40dc9fb6f881778fb (diff)
Adding comment and post vote loading indicators. Fixes #449
Diffstat (limited to 'ui/src/components/post.tsx')
-rw-r--r--ui/src/components/post.tsx8
1 files changed, 7 insertions, 1 deletions
diff --git a/ui/src/components/post.tsx b/ui/src/components/post.tsx
index c4bfccee..2005cc17 100644
--- a/ui/src/components/post.tsx
+++ b/ui/src/components/post.tsx
@@ -400,7 +400,11 @@ export class Post extends Component<any, PostState> {
found.score = res.comment.score;
found.upvotes = res.comment.upvotes;
found.downvotes = res.comment.downvotes;
- if (res.comment.my_vote !== null) found.my_vote = res.comment.my_vote;
+ if (res.comment.my_vote !== null) {
+ found.my_vote = res.comment.my_vote;
+ found.upvoteLoading = false;
+ found.downvoteLoading = false;
+ }
this.setState(this.state);
} else if (op == UserOperation.CreatePostLike) {
let res: CreatePostLikeResponse = msg;
@@ -408,6 +412,8 @@ export class Post extends Component<any, PostState> {
this.state.post.score = res.post.score;
this.state.post.upvotes = res.post.upvotes;
this.state.post.downvotes = res.post.downvotes;
+ this.state.post.upvoteLoading = false;
+ this.state.post.downvoteLoading = false;
this.setState(this.state);
} else if (op == UserOperation.EditPost) {
let res: PostResponse = msg;