Skip to content

Commit 5e8ce3b

Browse files
committed
reduce unnecessary re-indexing extra networks dir
1 parent e4dcdcc commit 5e8ce3b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

modules/ui_extra_networks.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -419,17 +419,17 @@ def create_ui(interface: gr.Blocks, unrelated_tabs, tabname):
419419

420420
def pages_html():
421421
if not ui.pages_contents:
422-
return refresh()
422+
return create_html()
423+
return ui.pages_contents
423424

425+
def create_html():
426+
ui.pages_contents = [pg.create_html(ui.tabname) for pg in ui.stored_extra_pages]
424427
return ui.pages_contents
425428

426429
def refresh():
427430
for pg in ui.stored_extra_pages:
428431
pg.refresh()
429-
430-
ui.pages_contents = [pg.create_html(ui.tabname) for pg in ui.stored_extra_pages]
431-
432-
return ui.pages_contents
432+
return create_html()
433433

434434
interface.load(fn=pages_html, inputs=[], outputs=[*ui.pages])
435435
button_refresh.click(fn=refresh, inputs=[], outputs=ui.pages)

0 commit comments

Comments
 (0)