mirror of
https://github.com/spacedriveapp/spacedrive
synced 2024-07-14 04:14:04 +00:00
parent
3f1ea3df10
commit
c57f91bf42
|
@ -176,20 +176,18 @@ export function Dialog<S extends FieldValues>({
|
|||
</Button>
|
||||
</RDialog.Close>
|
||||
);
|
||||
const disableCheck = props.errorMessageException
|
||||
? !form.formState.isValid &&
|
||||
!form.formState.errors.root?.serverError?.message?.startsWith(
|
||||
props.errorMessageException as string
|
||||
)
|
||||
: !form.formState.isValid;
|
||||
|
||||
const submitButton = (
|
||||
<Button
|
||||
type="submit"
|
||||
size="sm"
|
||||
disabled={
|
||||
form.formState.isSubmitting ||
|
||||
props.submitDisabled ||
|
||||
(!form.formState.isValid || props.errorMessageException
|
||||
? !form.formState.errors.root?.serverError?.message?.startsWith(
|
||||
props.errorMessageException as string
|
||||
)
|
||||
: false)
|
||||
}
|
||||
disabled={form.formState.isSubmitting || props.submitDisabled || disableCheck}
|
||||
variant={props.ctaDanger ? 'colored' : 'accent'}
|
||||
className={clsx(
|
||||
props.ctaDanger &&
|
||||
|
|
Loading…
Reference in a new issue