File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -596,11 +596,14 @@ function SampleWidget() {
596596 const prompt = textArea . value ;
597597 const encodedPrompt = encodeURIComponent ( prompt ) ;
598598 const url = `http://localhost:8000/generate?prompt=${ encodedPrompt } ` ;
599+
600+ let blinkInterval ;
601+
599602 try {
600603 generating = true ;
601604 activity . textMsg ( _ ( "Generating Audio..." ) , 2500 ) ;
602605
603- let blinkInterval = setInterval ( ( ) => {
606+ blinkInterval = setInterval ( ( ) => {
604607 activity . textMsg ( _ ( "Generating Audio..." ) , 1000 ) ;
605608 } , 5000 ) ;
606609
@@ -620,7 +623,9 @@ function SampleWidget() {
620623 }
621624 } catch ( error ) {
622625 generating = false ;
626+ clearInterval ( blinkInterval ) ;
623627 activity . textMsg ( _ ( "Error occurred" ) , 3000 ) ;
628+ submit . disabled = false ;
624629 }
625630 } ;
626631
You can’t perform that action at this time.
0 commit comments