diff --git a/src/streamlit_app.py b/src/streamlit_app.py index d04c3c6..20768e0 100644 --- a/src/streamlit_app.py +++ b/src/streamlit_app.py @@ -1078,15 +1078,17 @@ def trading_plan_page(): update_trading_plan(plan) st.success("Plan updated successfully!") st.experimental_set_query_params(rerun=True) - - # Add delete button - if st.button("Delete Plan", key="delete_plan_button"): - try: - delete_trading_plan(plan.id) - st.success("Plan deleted successfully!") - st.experimental_set_query_params(rerun=True) - except Exception as e: - st.error(f"Error deleting plan: {str(e)}") + except Exception as e: + st.error(f"Error updating plan: {str(e)}") + + # Delete button (at the same level as the update button) + if st.button("Delete Plan", key="delete_plan_button"): + try: + delete_trading_plan(plan.id) + st.success("Plan deleted successfully!") + st.experimental_set_query_params(rerun=True) + except Exception as e: + st.error(f"Error deleting plan: {str(e)}") else: st.info("No plans available to edit")