mabuseif commited on
Commit
f344d5e
·
verified ·
1 Parent(s): 5abbae0

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +24 -6
main.py CHANGED
@@ -134,7 +134,6 @@ class BuildSustain:
134
  "roofs": [],
135
  "floors": [],
136
  "windows": [],
137
- "doors": [],
138
  "skylights": []
139
  },
140
  "internal_loads": {
@@ -322,6 +321,25 @@ class BuildSustain:
322
  if key in st.session_state:
323
  st.session_state.pop(key, None)
324
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
325
  # Clear any module-specific rerun flags when changing pages
326
  st.session_state.module_rerun_flags = {}
327
 
@@ -332,11 +350,11 @@ class BuildSustain:
332
  """
333
  # Check for any module-specific rerun requests
334
  for module_name, should_rerun in st.session_state.module_rerun_flags.items():
335
- if should_rerun:
336
- # Clear the flag and trigger rerun
337
- st.session_state.module_rerun_flags[module_name] = False
338
- st.rerun()
339
- break # Only handle one rerun at a time
340
 
341
  def display_page(self, page: str):
342
  """
 
134
  "roofs": [],
135
  "floors": [],
136
  "windows": [],
 
137
  "skylights": []
138
  },
139
  "internal_loads": {
 
321
  if key in st.session_state:
322
  st.session_state.pop(key, None)
323
 
324
+ # Clear components-specific states when leaving the Building Components page
325
+ if previous_page == "Building Components":
326
+ keys_to_clear = [
327
+ "walls_editor",
328
+ "roofs_editor",
329
+ "floors_editor",
330
+ "windows_editor",
331
+ "skylights_editor",
332
+ "walls_action",
333
+ "roofs_action",
334
+ "floors_action",
335
+ "windows_action",
336
+ "skylights_action",
337
+ "components_rerun_pending"
338
+ ]
339
+ for key in keys_to_clear:
340
+ if key in st.session_state:
341
+ st.session_state.pop(key, None)
342
+
343
  # Clear any module-specific rerun flags when changing pages
344
  st.session_state.module_rerun_flags = {}
345
 
 
350
  """
351
  # Check for any module-specific rerun requests
352
  for module_name, should_rerun in st.session_state.module_rerun_flags.items():
353
+ if should_rer How to play:
354
+ # Clear the flag and trigger rerun
355
+ st.session_state.module_rerun_flags[module_name] = False
356
+ st.rerun()
357
+ break # Only handle one rerun at a time
358
 
359
  def display_page(self, page: str):
360
  """