@@ -35,7 +35,6 @@ export const ImportStack = Shade({
3535 const [ jsonInput , setJsonInput ] = useState ( 'json' , '' )
3636 const [ parsed , setParsed ] = useState < ParsedExport | null > ( 'parsed' , null )
3737 const [ parseError , setParseError ] = useState ( 'parseError' , '' )
38- const [ isImporting , setIsImporting ] = useState ( 'isImporting' , false )
3938
4039 const handleParse = ( ) => {
4140 try {
@@ -55,7 +54,6 @@ export const ImportStack = Shade({
5554
5655 const handleImport = async ( formData : ImportConfigPayload ) => {
5756 if ( ! parsed ) return
58- setIsImporting ( true )
5957 try {
6058 await injector . getInstance ( StacksApiClient ) . call ( {
6159 method : 'POST' ,
@@ -83,7 +81,6 @@ export const ImportStack = Shade({
8381 type : 'error' ,
8482 } )
8583 }
86- setIsImporting ( false )
8784 }
8885
8986 return (
@@ -133,7 +130,7 @@ export const ImportStack = Shade({
133130 </ div >
134131 </ Paper >
135132 ) : (
136- < Form < ImportConfigPayload > validate = { isImportConfigPayload } onSubmit = { ( data ) => void handleImport ( data ) } >
133+ < Form < ImportConfigPayload > validate = { isImportConfigPayload } onSubmit = { handleImport } disableOnSubmit >
137134 < Paper elevation = { 1 } style = { { display : 'flex' , flexDirection : 'column' , gap : '16px' } } >
138135 < h3 style = { { margin : '0' } } > Import: { parsed . stack . displayName } </ h3 >
139136 < div style = { { display : 'flex' , gap : '24px' , flexWrap : 'wrap' } } >
@@ -169,7 +166,6 @@ export const ImportStack = Shade({
169166 < Button
170167 type = "submit"
171168 variant = "contained"
172- loading = { isImporting }
173169 startIcon = { < Icon icon = { icons . upload } size = "small" /> }
174170 >
175171 Import
0 commit comments