fix generate forever

This commit is contained in:
Vladimir Mandic
2023-04-14 10:14:51 -04:00
parent 2ece9782e4
commit cd4a852ffb
2 changed files with 7 additions and 7 deletions
+4 -3
View File
@@ -132,13 +132,14 @@ addContextMenuEventListener = initResponse[2];
//Start example Context Menu Items
let generateOnRepeat = function(genbuttonid,interruptbuttonid){
let genbutton = gradioApp().querySelector(genbuttonid);
let interruptbutton = gradioApp().querySelector(interruptbuttonid);
if(!interruptbutton.offsetParent){
const busy = document.getElementById('progressbar')?.style.display == "block"
if(!busy){
genbutton.click();
}
clearInterval(window.generateOnRepeatInterval)
window.generateOnRepeatInterval = setInterval(function(){
if(!interruptbutton.offsetParent){
const busy = document.getElementById('progressbar')?.style.display == "block"
if(!busy){
genbutton.click();
}
},