James McCool
commited on
Commit
·
6cf69ca
1
Parent(s):
272cad3
Add functionality to clear player selection in Handbuilder tab of Streamlit app, resetting previous selections and refreshing lineup for improved user experience.
Browse files- src/streamlit_app.py +2 -0
src/streamlit_app.py
CHANGED
|
@@ -787,7 +787,9 @@ if selected_tab == 'Handbuilder':
|
|
| 787 |
clear_col, save_col, export_col, clear_saved_col, blank_col = st.columns([2, 2, 2, 2, 12])
|
| 788 |
with clear_col:
|
| 789 |
if st.button("Clear Lineup", key='clear_lineup_button'):
|
|
|
|
| 790 |
st.session_state['handbuilder_lineup'] = pd.DataFrame(columns=['Player', 'Position', 'Team', 'Salary', 'Median', '2x%', 'Own', 'Slot'])
|
|
|
|
| 791 |
with save_col:
|
| 792 |
if st.button("Save Lineup", key='save_lineup_button'):
|
| 793 |
if 'saved_lineups' in st.session_state:
|
|
|
|
| 787 |
clear_col, save_col, export_col, clear_saved_col, blank_col = st.columns([2, 2, 2, 2, 12])
|
| 788 |
with clear_col:
|
| 789 |
if st.button("Clear Lineup", key='clear_lineup_button'):
|
| 790 |
+
st.session_state['previous_player_selection'] = []
|
| 791 |
st.session_state['handbuilder_lineup'] = pd.DataFrame(columns=['Player', 'Position', 'Team', 'Salary', 'Median', '2x%', 'Own', 'Slot'])
|
| 792 |
+
st.rerun()
|
| 793 |
with save_col:
|
| 794 |
if st.button("Save Lineup", key='save_lineup_button'):
|
| 795 |
if 'saved_lineups' in st.session_state:
|