Skip to content

Commit

Permalink
fix disabled when not authed
Browse files Browse the repository at this point in the history
  • Loading branch information
vikibrezinova committed Apr 13, 2024
1 parent 4ffaf96 commit 39a63c2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/Problems/Problem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ export const Problem: FC<{
const handleUploadClick = () => {
if (!isAuthed) {
displayLoginDialog()
} else if (!registered && canRegister) {
} else if (!registered) {
displayRegisterDialog()
} else if (registered) {
} else {
setDisplayProblemUploadForm((prevState) => !prevState)
setDisplayActions(false)
}
Expand Down Expand Up @@ -121,7 +121,7 @@ export const Problem: FC<{
<Button onClick={handleDiscussionButtonClick} variant="button2">
diskusia ({problem.num_comments}){' '}
</Button>
<Button onClick={handleUploadClick} disabled={!canSubmit || !canRegister} variant="button2">
<Button onClick={handleUploadClick} disabled={!canSubmit || (isAuthed && !canRegister)} variant="button2">
odovzdať
</Button>
</Stack>
Expand Down

0 comments on commit 39a63c2

Please sign in to comment.