From 4c8bf3f66aa29413e1fb81b1fd75680f822ebb50 Mon Sep 17 00:00:00 2001 From: CalamitousFelicitousness Date: Sat, 23 Aug 2025 04:29:19 +0100 Subject: [PATCH] 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. --- javascript/extraNetworks.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/javascript/extraNetworks.js b/javascript/extraNetworks.js index 81d11d684..2292b66af 100644 --- a/javascript/extraNetworks.js +++ b/javascript/extraNetworks.js @@ -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';