Skip to content

Commit

Permalink
fix streamlit_app.py
Browse files Browse the repository at this point in the history
  • Loading branch information
geezacoleman committed Sep 26, 2023
1 parent 2d381dd commit 20c044c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion demos/streamlit_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,13 @@ def main():
}
config.update(updated_config)

st.session_state.current_file_idx = (len(uploaded_files) - 1) if current_file_idx >= len(uploaded_files) else current_file_idx
if current_file_idx >= len(uploaded_files) and current_file_idx != 0:
st.session_state.current_file_idx = (len(uploaded_files) - 1)
elif current_file_idx < 0:
st.session_state.current_file_idx = 0
else:
st.session_state.current_file_idx = current_file_idx

if uploaded_files and 0 <= current_file_idx:
current_file_idx = st.session_state.get("current_file_idx", 0)
file_type = get_file_type(uploaded_files[current_file_idx])
Expand Down

0 comments on commit 20c044c

Please sign in to comment.