diff options
author | Dessalines <tyhou13@gmx.com> | 2020-01-19 19:48:34 -0500 |
---|---|---|
committer | Dessalines <tyhou13@gmx.com> | 2020-01-19 19:48:34 -0500 |
commit | f020e89a8c8b5a8dafc41cf40dc9fb6f881778fb (patch) | |
tree | 8d09a52b28a5306bc7a75b834868a972e6b310e8 /ui/src/components/post-listing.tsx | |
parent | 96684ef2a09543e2378c985666ef4471a3b99608 (diff) |
Fixing new comments and posts voting issue. Fixes #422
Diffstat (limited to 'ui/src/components/post-listing.tsx')
-rw-r--r-- | ui/src/components/post-listing.tsx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ui/src/components/post-listing.tsx b/ui/src/components/post-listing.tsx index c945806b..0c6d44b4 100644 --- a/ui/src/components/post-listing.tsx +++ b/ui/src/components/post-listing.tsx @@ -84,6 +84,15 @@ export class PostListing extends Component<PostListingProps, PostListingState> { this.handleEditCancel = this.handleEditCancel.bind(this); } + componentDidUpdate(prevProps: PostListingProps) { + if (prevProps.post.my_vote !== this.props.post.my_vote) { + this.setState({ + my_vote: this.props.post.my_vote, + score: this.props.post.score, + }); + } + } + render() { return ( <div class="row"> |