Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -573,14 +573,16 @@ def render_sidebar():
|
|
573 |
horizontal=True # Make radio horizontal if preferred
|
574 |
)
|
575 |
|
576 |
-
|
577 |
if selected_tool != current_tool_name:
|
578 |
st.session_state.selected_object = selected_tool
|
579 |
add_action_log(f"Selected tool: {selected_tool}")
|
580 |
-
#
|
581 |
-
|
582 |
-
|
583 |
-
|
|
|
|
|
584 |
|
585 |
# --- Action Log ---
|
586 |
st.markdown("---")
|
|
|
573 |
horizontal=True # Make radio horizontal if preferred
|
574 |
)
|
575 |
|
576 |
+
# Handle tool change
|
577 |
if selected_tool != current_tool_name:
|
578 |
st.session_state.selected_object = selected_tool
|
579 |
add_action_log(f"Selected tool: {selected_tool}")
|
580 |
+
# CORRECTED: Use streamlit_js_eval instead of sync
|
581 |
+
# This sends the update to JS without needing a return value immediately
|
582 |
+
streamlit_js_eval(js_code=f"updateSelectedObjectType({json.dumps(selected_tool)});", key=f"update_tool_js_{selected_tool}")
|
583 |
+
# Rerun to potentially update other UI elements if needed, though maybe optional
|
584 |
+
# if only JS state needs update for the tool. Let's keep it for now.
|
585 |
+
st.rerun()
|
586 |
|
587 |
# --- Action Log ---
|
588 |
st.markdown("---")
|