Skip to content

Commit

Permalink
clear session state before switching workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
axelwalter committed Sep 19, 2023
1 parent 8f8fc14 commit e802a45
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pages/0_📁_File_Upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@

st.title("File Upload")

if "selected-mzML-files" not in st.session_state:
st.session_state["selected-mzML-files"] = params["selected-mzML-files"]

tabs = ["File Upload", "Example Data"]
if st.session_state.location == "local":
tabs.append("Files from local folder")
Expand Down
3 changes: 3 additions & 0 deletions src/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ def render_sidebar(page: str = "") -> None:
elif st.session_state.location == "local":
# Define callback function to change workspace
def change_workspace():
for key in params.keys():
if key in st.session_state.keys():
del st.session_state[key]
st.session_state.workspace = Path(
workspaces_dir, st.session_state["chosen-workspace"]
)
Expand Down

0 comments on commit e802a45

Please sign in to comment.