@@ -76,21 +76,21 @@ const PersonalDetails = ({ pupil, refresh, form, isUpdating, updatePupil }: Pers
7676 setDescriptionForMatch,
7777 weeklyAvailability,
7878 setWeeklyAvailability,
79- age ,
80- setAge ,
79+ currentAge ,
80+ setCurrentAge ,
8181 } = form ;
8282
8383 const [ mutationCreateLoginToken ] = useMutation ( CREATE_LOGIN_TOKEN_MUTATION ) ;
8484 const [ errors , setErrors ] = useState < FormErrors > ( { } ) ;
8585
8686 useEffect ( ( ) => {
8787 let updatedErrors = { } ;
88- if ( ! ! age && age < MIN_AGE_PUPIL ) {
88+ if ( ! ! currentAge && currentAge < MIN_AGE_PUPIL ) {
8989 updatedErrors = { ...updatedErrors , age : t ( 'registration.steps.userAge.tooYoungError' , { minAge : MIN_AGE_PUPIL } ) } ;
9090 }
9191
9292 setErrors ( updatedErrors ) ;
93- } , [ languages , grade , subjects , age , t ] ) ;
93+ } , [ languages , grade , subjects , currentAge , t ] ) ;
9494
9595 const impersonate = async ( ) => {
9696 // We need to work around the popup blocker of modern browsers, as you can only
@@ -118,7 +118,6 @@ const PersonalDetails = ({ pupil, refresh, form, isUpdating, updatePupil }: Pers
118118 }
119119 } ;
120120
121- console . log ( errors ) ;
122121 return (
123122 < >
124123 < div className = "flex w-full justify-between mb-10" >
@@ -169,8 +168,8 @@ const PersonalDetails = ({ pupil, refresh, form, isUpdating, updatePupil }: Pers
169168 < Label > Alter</ Label >
170169 < Input
171170 className = "w-full max-w-40"
172- value = { age || '' }
173- onChangeText = { ( e ) => setAge ( Number ( e . replace ( / \D / g, '' ) . substring ( 0 , 2 ) ) ) }
171+ value = { currentAge || '' }
172+ onChangeText = { ( e ) => setCurrentAge ( Number ( e . replace ( / \D / g, '' ) . substring ( 0 , 2 ) ) ) }
174173 errorMessage = { errors . age }
175174 errorMessageClassName = "hidden"
176175 min = { MIN_AGE_PUPIL }
0 commit comments