From c63be26cb7a24f49c02537fbde311388384a1af3 Mon Sep 17 00:00:00 2001 From: anapnoe <124302297+anapnoe@users.noreply.github.com> Date: Wed, 19 Apr 2023 05:28:16 +0300 Subject: [PATCH] fix Generate button state gets stuck sometimes when switching tabs #60 --- javascript/progressbar.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/javascript/progressbar.js b/javascript/progressbar.js index b1a68245..e3419376 100644 --- a/javascript/progressbar.js +++ b/javascript/progressbar.js @@ -157,11 +157,21 @@ function requestProgress(id_task, progressbarContainer, gallery, atEnd, onProgre livePreview.classList.remove("dropPreview"); } - var removeProgressBar = function(){ + var removeProgressBar = function(){ setTitle("") - parentProgressbar.removeChild(divProgress) - if(parentGallery) parentGallery.removeChild(livePreview) - atEnd() + if(divProgress){ + parentProgressbar.removeChild(divProgress) + } + + if(progressbarContainer.id == "txt2img_gallery_container"){ + showSubmitButtons('txt2img', true); + }else if(progressbarContainer.id == "img2img_gallery_container"){ + showSubmitButtons('img2img', true); + } + if(livePreview){ + if(parentGallery) parentGallery.removeChild(livePreview) + } + atEnd() } var fun = function(id_task, id_live_preview){