James McCool commited on
Commit
81fc9e2
·
1 Parent(s): 8ada274

Enhance portfolio reset functionality in app.py

Browse files

- Added deletion of 'display_contest_info' from session state when clearing the portfolio, ensuring a complete reset of relevant data.
- This improvement streamlines user experience by providing a more thorough reset process during portfolio management.

Files changed (1) hide show
  1. app.py +1 -0
app.py CHANGED
@@ -181,6 +181,7 @@ with tab1:
181
  st.info("If you have a portfolio of lineups, you can upload them here to see how they would have performed against the field")
182
  if st.button('Clear portfolio', key='reset2'):
183
  st.session_state['portfolio_df'] = None
 
184
  st.session_state['portfolio_file'] = st.file_uploader("Upload Portfolio File (CSV or Excel)", type=['csv', 'xlsx', 'xls'])
185
  try:
186
  st.session_state['portfolio_df'] = pd.read_csv(st.session_state['portfolio_file'])
 
181
  st.info("If you have a portfolio of lineups, you can upload them here to see how they would have performed against the field")
182
  if st.button('Clear portfolio', key='reset2'):
183
  st.session_state['portfolio_df'] = None
184
+ del st.session_state['display_contest_info']
185
  st.session_state['portfolio_file'] = st.file_uploader("Upload Portfolio File (CSV or Excel)", type=['csv', 'xlsx', 'xls'])
186
  try:
187
  st.session_state['portfolio_df'] = pd.read_csv(st.session_state['portfolio_file'])