Skip to content

Commit

Permalink
add: case control if user exits filedialog without selection
Browse files Browse the repository at this point in the history
  • Loading branch information
singjc committed Aug 22, 2024
1 parent 666fe4d commit 1c56cc6
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/workflow/StreamlitUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,15 @@ def upload_widget(
file_types,
st.session_state["previous_dir"],
)
st.write(local_files)
my_bar = st.progress(0)
for i, f in enumerate(local_files):
with open(external_files, "a") as f_handle:
f_handle.write(f"{f}\n")
my_bar.empty()
st.success("Successfully copied files!")

st.session_state["previous_dir"] = Path(local_files[0]).parent
if local_files:
my_bar = st.progress(0)
for i, f in enumerate(local_files):
with open(external_files, "a") as f_handle:
f_handle.write(f"{f}\n")
my_bar.empty()
st.success("Successfully copied files!")
st.session_state["previous_dir"] = Path(local_files[0]).parent

# Local file upload option: via directory path
if st.session_state.location == "local":
Expand Down

0 comments on commit 1c56cc6

Please sign in to comment.