Update extraNetworks.js

Additional fix for lastTab updating with an empty string. This could cause the issue to reemerge if one of the three tabs was the initial tab upon startup.
This commit is contained in:
CalamitousFelicitousness
2025-08-23 04:29:19 +01:00
committed by GitHub
parent 84df9f7b4d
commit 4c8bf3f66a
+7 -2
View File
@@ -14,8 +14,13 @@ const getENActiveTab = () => {
else if (gradioApp().getElementById('extras_image')?.checkVisibility()) tabName = 'process';
else if (gradioApp().getElementById('interrogate_image')?.checkVisibility()) tabName = 'caption';
else if (gradioApp().getElementById('tab-gallery-search')?.checkVisibility()) tabName = 'gallery';
if (['process', 'caption', 'gallery'].includes(tabName)) tabName = lastTab;
else lastTab = tabName;
if (['process', 'caption', 'gallery'].includes(tabName)) {
tabName = lastTab;
} else if (tabName !== '') {
lastTab = tabName;
}
if (tabName !== '') return tabName;
// legacy method
if (gradioApp().getElementById('tab_txt2img')?.style.display === 'block') tabName = 'txt2img';