JSenkCC commited on
Commit
2d27621
·
verified ·
1 Parent(s): 59d0787

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -1
app.py CHANGED
@@ -201,12 +201,20 @@ def project_view_page():
201
  st.session_state.username = None
202
  st.session_state.page = "login"
203
 
 
 
 
 
204
  # Main content for project page
205
  st.subheader(f"Project: {st.session_state.current_project}")
206
  st.write("Manage your project and explore its files.")
207
 
208
- # Button to display file structure
209
  if st.button("Show File Structure"):
 
 
 
 
210
  user_folder = os.path.join("user_projects", st.session_state.username)
211
  project_folder = os.path.join(user_folder, st.session_state.current_project)
212
 
@@ -227,6 +235,7 @@ def project_view_page():
227
  for file in files:
228
  st.write(f"{sub_indent}📄 {file}")
229
 
 
230
  if __name__ == "__main__":
231
  main()
232
 
 
201
  st.session_state.username = None
202
  st.session_state.page = "login"
203
 
204
+ # Initialize toggle state for file structure
205
+ if "show_file_structure" not in st.session_state:
206
+ st.session_state.show_file_structure = False
207
+
208
  # Main content for project page
209
  st.subheader(f"Project: {st.session_state.current_project}")
210
  st.write("Manage your project and explore its files.")
211
 
212
+ # Toggle button for file structure
213
  if st.button("Show File Structure"):
214
+ st.session_state.show_file_structure = not st.session_state.show_file_structure
215
+
216
+ # Display file structure if toggled on
217
+ if st.session_state.show_file_structure:
218
  user_folder = os.path.join("user_projects", st.session_state.username)
219
  project_folder = os.path.join(user_folder, st.session_state.current_project)
220
 
 
235
  for file in files:
236
  st.write(f"{sub_indent}📄 {file}")
237
 
238
+
239
  if __name__ == "__main__":
240
  main()
241