Skip to content

Commit

Permalink
feat(mellow-react): fix issues with updating fields
Browse files Browse the repository at this point in the history
  • Loading branch information
DominusKelvin committed Sep 20, 2024
1 parent 7219d6c commit 286bd38
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions templates/mellow-react/assets/js/pages/auth/reset-password.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,12 @@ export default function ResetPassword({ token }) {
})

const disableResetPasswordButton = useMemo(() => {
const emailRegex = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/
const isEmailValid = emailRegex.test(data.email)
if (!isEmailValid) return true
if (!passwordIsValid) return true
if (!containsSpecialChars) return true
if (form.processing) return true
if (form.password != form.confirmPassword) return true

if (data.password != data.confirmPassword) return true
return false
}, [])
}, [data.password, data.confirmPassword, form.processing])

function submit(e) {
e.preventDefault()
Expand Down

0 comments on commit 286bd38

Please sign in to comment.