Skip to content

Commit

Permalink
fix(onboarding-ui): Disable registration button when offline registra…
Browse files Browse the repository at this point in the history
…tion succeed (#1227)
  • Loading branch information
tiagoevanp authored Nov 27, 2023
1 parent bbb77d8 commit 414b1fc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/pretty-students-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rocket.chat/onboarding-ui": patch
---

Fix offline registration wizard validation
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const PasteStep = ({ setStep }: PasteStepProps): ReactElement => {
const isMobile = !breakpoints.includes('md');
const {
register,
formState: { isSubmitting, isValid },
formState: { isSubmitting, isValidating, isSubmitSuccessful },
} = useFormContext();

return (
Expand Down Expand Up @@ -59,7 +59,11 @@ const PasteStep = ({ setStep }: PasteStepProps): ReactElement => {
<Form.Footer>
<Box display='flex' flexDirection='column'>
<ButtonGroup vertical={isMobile} flexGrow={1}>
<Button type='submit' primary disabled={isSubmitting || !isValid}>
<Button
type='submit'
primary
disabled={isSubmitting || isValidating || isSubmitSuccessful}
>
{t('component.form.action.completeRegistration')}
</Button>
<Button type='button' onClick={() => setStep(Steps.COPY)}>
Expand Down

0 comments on commit 414b1fc

Please sign in to comment.