File tree Expand file tree Collapse file tree 1 file changed +1
-9
lines changed
web/app/(humanInputLayout)/form/[token] Expand file tree Collapse file tree 1 file changed +1
-9
lines changed Original file line number Diff line number Diff line change @@ -41,12 +41,12 @@ const FormContent = () => {
4141
4242 const [ inputs , setInputs ] = useState < Record < string , string > > ( { } )
4343 const [ success , setSuccess ] = useState ( false )
44- const [ expired , setExpired ] = useState ( false )
4544
4645 const { mutate : submitForm , isPending : isSubmitting } = useSubmitHumanInputForm ( )
4746
4847 const { data : formData , isLoading, error } = useGetHumanInputForm ( token )
4948
49+ const expired = ( error as HumanInputFormError | null ) ?. code === 'human_input_form_expired'
5050 const submitted = ( error as HumanInputFormError | null ) ?. code === 'human_input_form_submitted'
5151
5252 const splitByOutputVar = ( content : string ) : string [ ] => {
@@ -86,14 +86,6 @@ const FormContent = () => {
8686 onSuccess : ( ) => {
8787 setSuccess ( true )
8888 } ,
89- onError : async ( error ) => {
90- if ( error instanceof Response && error . status && error . json ) {
91- const errorData = await error . json ( ) as { code : string , message : string }
92- if ( errorData . code === 'human_input_form_expired' ) {
93- setExpired ( true )
94- }
95- }
96- } ,
9789 } ,
9890 )
9991 }
You can’t perform that action at this time.
0 commit comments