Skip to content
This repository has been archived by the owner on Aug 11, 2024. It is now read-only.

Commit

Permalink
fix: ui display on click preview
Browse files Browse the repository at this point in the history
  • Loading branch information
xingren23 committed Dec 14, 2023
1 parent c9414fd commit 840ec10
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions pages/3_πŸ“š_Workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,7 @@ def click_edit_app(app):
st.session_state.pop('preview_app', None)
st.session_state.pop('publish_app', None)

def click_preview_app(app):
if not check_comfyui_alive():
logger.warning("ComfyUI server is not alive, please check it")
st.session_state['app_preview_ret'] = AppStatus.ERROR.value
return

def click_preview_app(app):
logger.info(f"preview app: {app.name}")
st.session_state['preview_app'] = app
st.session_state.pop('new_app', None)
Expand Down Expand Up @@ -208,9 +203,10 @@ def create_operation_ui(app):
key=f"{id}-button-preview",
on_click=click_preview_app, args=(app,), disabled=disabled)
if preview_button:
app_preview_ret = st.session_state['app_preview_ret']
if app_preview_ret == AppStatus.ERROR.value:
if not check_comfyui_alive():
logger.warning("ComfyUI server is not alive, please check it")
st.error(f"Preview app {name} failed, please check the log")
st.stop()

edit_button = operate_row.button("✏️ Edit", help="Edit the app", key=f"{id}-button-edit",
on_click=click_edit_app, args=(app,), disabled=disabled)
Expand Down

0 comments on commit 840ec10

Please sign in to comment.