Skip to content

Commit

Permalink
Fix submit button being disabled for downvoting in casual vote box
Browse files Browse the repository at this point in the history
  • Loading branch information
ajayyy committed Feb 13, 2025
1 parent 2f9ecf6 commit 337362c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/submission/CasualVoteComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,11 @@ export const CasualVoteComponent = (props: CasualVoteComponentProps) => {

<div className="cbVoteButtonContainer">
<button className="cbNoticeButton cbVoteButton"
disabled={currentlySubmitting || voteType === null || !voteInfoReady}
disabled={currentlySubmitting || voteType === null || (!voteInfoReady && voteType === CasualVoteType.Like)}
onClick={() => {
if (voteType) {
props.submitClicked([...voteInfo.current], voteType === CasualVoteType.Dislike);
const downvote = voteType === CasualVoteType.Dislike;
props.submitClicked(downvote ? [] : [...voteInfo.current], downvote);

setCurrentlySubmitting(true);
}
Expand Down

0 comments on commit 337362c

Please sign in to comment.