Skip to content

Commit

Permalink
refactor: index out of selectbox
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronan committed Apr 23, 2024
1 parent a4cab65 commit bc7f1a5
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions app/pages/4_Clean_Tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,16 +136,18 @@ def update_df_csv_to_save() -> None:
)

with col4:
index = (
list(st.session_state.tables.keys()).index(
st.session_state["algorithm_name"],
)
if "algorithm_name" in st.session_state
else 0
)

st.session_state["algorithm_name"] = st.selectbox(
"Choose the extracted table you want to see",
list(st.session_state.tables.keys()),
index=(
list(st.session_state.tables.keys()).index(
st.session_state["algorithm_name"],
)
if "algorithm_name" in st.session_state
else 0
),
index=index,
on_change=set_algorithm_name,
args=("selectbox2",),
key="selectbox2",
Expand Down

0 comments on commit bc7f1a5

Please sign in to comment.