File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -460,7 +460,7 @@ function ExportFile() {
460460 // call export graphQL api to get the AWS S3 url
461461 exportJSON ( { variables : { repoId } } ) ;
462462 } }
463- disabled = { loading }
463+ disabled = { true }
464464 >
465465 Python File
466466 </ Button >
@@ -495,7 +495,7 @@ function ExportJSON() {
495495 // call export graphQL api to get the AWS S3 url
496496 exportJSON ( { variables : { repoId } } ) ;
497497 } }
498- disabled = { loading }
498+ disabled = { true }
499499 >
500500 Raw JSON
501501 </ Button >
@@ -514,8 +514,10 @@ function ExportSVG() {
514514 " " ,
515515 "-"
516516 ) } -${ repoId } -${ new Date ( ) . toISOString ( ) } .svg`;
517+ const [ loading , setLoading ] = useState ( false ) ;
517518
518519 const onClick = ( ) => {
520+ setLoading ( true ) ;
519521 const elem = document . querySelector ( ".react-flow" ) ;
520522 if ( ! elem ) return ;
521523 toSvg ( elem as HTMLElement , {
@@ -536,11 +538,18 @@ function ExportSVG() {
536538 a . setAttribute ( "download" , filename ) ;
537539 a . setAttribute ( "href" , dataUrl ) ;
538540 a . click ( ) ;
541+ setLoading ( false ) ;
539542 } ) ;
540543 } ;
541544
542545 return (
543- < Button variant = "outlined" size = "small" color = "secondary" onClick = { onClick } >
546+ < Button
547+ variant = "outlined"
548+ size = "small"
549+ color = "secondary"
550+ onClick = { onClick }
551+ disabled = { loading }
552+ >
544553 Download Image
545554 </ Button >
546555 ) ;
You can’t perform that action at this time.
0 commit comments