Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -321,7 +321,7 @@ class BuildSustain:
|
|
321 |
if key in st.session_state:
|
322 |
st.session_state.pop(key, None)
|
323 |
|
324 |
-
# Clear
|
325 |
if previous_page == "Building Components":
|
326 |
keys_to_clear = [
|
327 |
"walls_editor",
|
@@ -350,11 +350,11 @@ class BuildSustain:
|
|
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
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
|
359 |
def display_page(self, page: str):
|
360 |
"""
|
|
|
321 |
if key in st.session_state:
|
322 |
st.session_state.pop(key, None)
|
323 |
|
324 |
+
# Clear component-specific states when leaving the Building Components page
|
325 |
if previous_page == "Building Components":
|
326 |
keys_to_clear = [
|
327 |
"walls_editor",
|
|
|
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_rerun:
|
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 |
"""
|