Merge branch 'main' into feat/create-post-file-upload-a11y

This commit is contained in:
SleeplessOne1917 2023-07-02 22:22:15 +00:00 committed by GitHub
commit e7f7bc2e36
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -64,8 +64,6 @@ const handleUpvote = (i: VoteButtons) => {
auth: myAuthRequired(),
});
}
i.setState({ upvoteLoading: false });
};
const handleDownvote = (i: VoteButtons) => {
@ -86,7 +84,6 @@ const handleDownvote = (i: VoteButtons) => {
auth: myAuthRequired(),
});
}
i.setState({ downvoteLoading: false });
};
export class VoteButtonsCompact extends Component<
@ -102,6 +99,15 @@ export class VoteButtonsCompact extends Component<
super(props, context);
}
componentWillReceiveProps(nextProps: VoteButtonsProps) {
if (this.props !== nextProps) {
this.setState({
upvoteLoading: false,
downvoteLoading: false,
});
}
}
render() {
return (
<>
@ -172,6 +178,15 @@ export class VoteButtons extends Component<VoteButtonsProps, VoteButtonsState> {
super(props, context);
}
componentWillReceiveProps(nextProps: VoteButtonsProps) {
if (this.props !== nextProps) {
this.setState({
upvoteLoading: false,
downvoteLoading: false,
});
}
}
render() {
return (
<div className="vote-bar small text-center">