File tree 1 file changed +13
-1
lines changed
site/src/pages/CreateTemplatePage
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ import {
16
16
} from "pages/CreateTemplatePage/TemplateUpload"
17
17
import { useFormik } from "formik"
18
18
import { SelectedTemplate } from "pages/CreateWorkspacePage/SelectedTemplate"
19
- import { FC } from "react"
19
+ import { FC , useEffect } from "react"
20
20
import { useTranslation } from "react-i18next"
21
21
import {
22
22
nameValidator ,
@@ -224,6 +224,18 @@ export const CreateTemplateForm: FC<CreateTemplateFormProps> = ({
224
224
const { t } = useTranslation ( "createTemplatePage" )
225
225
const { t : commonT } = useTranslation ( "common" )
226
226
227
+ useEffect ( ( ) => {
228
+ if ( error ) {
229
+ window . scrollTo ( 0 , 0 )
230
+ }
231
+ } , [ error ] )
232
+
233
+ useEffect ( ( ) => {
234
+ if ( jobError ) {
235
+ window . scrollTo ( 0 , document . body . scrollHeight )
236
+ }
237
+ } , [ logs , jobError ] )
238
+
227
239
return (
228
240
< HorizontalForm onSubmit = { form . handleSubmit } >
229
241
{ /* General info */ }
You can’t perform that action at this time.
0 commit comments