Skip to content

Commit

Permalink
reduce unnecessary re-indexing extra networks dir
Browse files Browse the repository at this point in the history
  • Loading branch information
w-e-w committed Jan 3, 2024
1 parent e4dcdcc commit 312d8e1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions modules/ui_extra_networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,17 +419,17 @@ def create_ui(interface: gr.Blocks, unrelated_tabs, tabname):

def pages_html():
if not ui.pages_contents:
return refresh()
create_html()
return ui.pages_contents

def create_html():
ui.pages_contents = [pg.create_html(ui.tabname) for pg in ui.stored_extra_pages]
return ui.pages_contents

def refresh():
for pg in ui.stored_extra_pages:
pg.refresh()

ui.pages_contents = [pg.create_html(ui.tabname) for pg in ui.stored_extra_pages]

return ui.pages_contents
return create_html()

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

0 comments on commit 312d8e1

Please sign in to comment.