fix calling extraNetworksSetup twise

this also has the added effect of moving the controls the right side
as it was previously blocked by a invisible duplicate
 element
This commit is contained in:
w-e-w 2024-10-22 17:40:39 +09:00
parent 72632242f7
commit e3b72bdb71
2 changed files with 3 additions and 4 deletions

View file

@ -2167,7 +2167,7 @@ async function extraNetworksSetupTab(tabname) {
}
}
async function extraNetworksSetup() {
async function extraNetworksSetup(tabname) {
/** Sets up all tabs for extra networks.
*
* This function is called from `modules/ui_extra_networks.py::create_ui()`
@ -2177,8 +2177,7 @@ async function extraNetworksSetup() {
await waitForBool(initialUiOptionsLoaded);
extra_networks_setup_debounce_timer = setTimeout(async() => {
await Promise.all([
extraNetworksSetupTab('txt2img'),
extraNetworksSetupTab('img2img'),
extraNetworksSetupTab(tabname),
]);
extraNetworksSetupEventDelegators();
extra_networks_setup_debounce_timer = null;

View file

@ -1450,7 +1450,7 @@ def create_ui(interface: gr.Blocks, unrelated_tabs, tabname):
_js="setupAllResizeHandles",
).then(
fn=lambda: None,
_js="extraNetworksSetup",
_js="function(){extraNetworksSetup('" + tabname + "')}",
)
return ui