Skip to content

Commit 88419a6

Browse files
committed
reset form only if view is not email
1 parent 0f6b842 commit 88419a6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/template-retail-react-app/app/hooks/use-auth-modal.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,11 @@ export const AuthModal = ({
249249
}, [form.control?.fieldsRef?.current])
250250

251251
useEffect(() => {
252-
form.reset()
252+
// we don't want to reset the form on email view
253+
// because we want to pass the email to PasswordlessEmailConfirmation
254+
if (currentView !== EMAIL_VIEW) {
255+
form.reset()
256+
}
253257
}, [currentView])
254258

255259
useEffect(() => {

0 commit comments

Comments
 (0)