Browse Source

fixed logic for updating the displayed generation params when the image modal is closed

Liam 2 years ago
parent
commit
54fd00ff8f
1 changed files with 3 additions and 3 deletions
  1. 3 3
      javascript/generationParams.js

+ 3 - 3
javascript/generationParams.js

@@ -16,9 +16,9 @@ onUiUpdate(function(){
 
 
 let modalObserver = new MutationObserver(function(mutations) {
 let modalObserver = new MutationObserver(function(mutations) {
 	mutations.forEach(function(mutationRecord) {
 	mutations.forEach(function(mutationRecord) {
-		let selectedTab = gradioApp().querySelector('#tabs div button.bg-white')?.innerText
-		if (mutationRecord.target.style.display === 'none' && selectedTab === 'txt2img' || selectedTab === 'img2img')
-			gradioApp().getElementById(selectedTab+"_generation_info_button").click()
+		let selectedTab = gradioApp().querySelector('#tabs div button.selected')?.innerText
+		if (mutationRecord.target.style.display === 'none' && (selectedTab === 'txt2img' || selectedTab === 'img2img'))
+			gradioApp().getElementById(selectedTab+"_generation_info_button")?.click()
 	});
 	});
 });
 });