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

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +14 -1
main.py CHANGED
@@ -27,7 +27,7 @@ from app.intro import display_intro_page
27
  from app.building_information import display_building_info_page
28
  from app.climate_data import display_climate_page
29
  from app.materials_library import display_materials_page, Material, GlazingMaterial, MaterialCategory
30
- from app.construction import display_construction_page
31
  from app.components import display_components_page
32
  from app.internal_loads import display_internal_loads_page
33
  from app.hvac_loads import display_hvac_loads_page
@@ -309,6 +309,19 @@ class BuildSustain:
309
  if key in st.session_state:
310
  st.session_state.pop(key, None)
311
 
 
 
 
 
 
 
 
 
 
 
 
 
 
312
  # Clear any module-specific rerun flags when changing pages
313
  st.session_state.module_rerun_flags = {}
314
 
 
27
  from app.building_information import display_building_info_page
28
  from app.climate_data import display_climate_page
29
  from app.materials_library import display_materials_page, Material, GlazingMaterial, MaterialCategory
30
+ from app.construction import display_construction_page, get_available_constructions
31
  from app.components import display_components_page
32
  from app.internal_loads import display_internal_loads_page
33
  from app.hvac_loads import display_hvac_loads_page
 
309
  if key in st.session_state:
310
  st.session_state.pop(key, None)
311
 
312
+ # Clear construction-specific states when leaving the Construction page
313
+ if previous_page == "Construction":
314
+ keys_to_clear = [
315
+ "construction_action",
316
+ "construction_rerun_pending",
317
+ "construction_form_state",
318
+ "construction_editor",
319
+ "rerun_trigger"
320
+ ]
321
+ for key in keys_to_clear:
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