about summary refs log tree commit diff
path: root/src/screens/Signup/index.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/screens/Signup/index.tsx')
-rw-r--r--src/screens/Signup/index.tsx11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/screens/Signup/index.tsx b/src/screens/Signup/index.tsx
index 189760460..0e1a2e61f 100644
--- a/src/screens/Signup/index.tsx
+++ b/src/screens/Signup/index.tsx
@@ -16,6 +16,7 @@ import {
   reducer,
   SignupContext,
   SignupStep,
+  useSubmitSignup,
 } from '#/screens/Signup/state'
 import {StepCaptcha} from '#/screens/Signup/StepCaptcha'
 import {StepHandle} from '#/screens/Signup/StepHandle'
@@ -33,6 +34,7 @@ export function Signup({onPressBack}: {onPressBack: () => void}) {
   const {screen} = useAnalytics()
   const [state, dispatch] = React.useReducer(reducer, initialState)
   const {gtMobile} = useBreakpoints()
+  const submit = useSubmitSignup()
 
   const activeStarterPack = useActiveStarterPack()
   const {
@@ -81,6 +83,15 @@ export function Signup({onPressBack}: {onPressBack: () => void}) {
     }
   }, [_, serviceInfo, isError])
 
+  React.useEffect(() => {
+    if (state.pendingSubmit) {
+      if (!state.pendingSubmit.mutableProcessed) {
+        state.pendingSubmit.mutableProcessed = true
+        submit(state, dispatch)
+      }
+    }
+  }, [state, dispatch, submit])
+
   return (
     <SignupContext.Provider value={{state, dispatch}}>
       <LoggedOutLayout