Spaces:
Sleeping
Sleeping
[FIX] method automatically activated
Browse files- tabs/tab2_constraints.py +3 -0
tabs/tab2_constraints.py
CHANGED
|
@@ -388,6 +388,9 @@ def _sync_constraint_widgets(cost_sliders_norm):
|
|
| 388 |
for m, c in st.session_state.constraints.items():
|
| 389 |
if get_all_missing_required(m, cost_sliders_norm):
|
| 390 |
st.session_state.constraints[m]["active"] = False
|
|
|
|
|
|
|
|
|
|
| 391 |
st.session_state.pop(f"toggle_{m}", None)
|
| 392 |
st.session_state.pop(f"cap_type_{m}", None)
|
| 393 |
st.session_state.pop(f"slider_{m}", None)
|
|
|
|
| 388 |
for m, c in st.session_state.constraints.items():
|
| 389 |
if get_all_missing_required(m, cost_sliders_norm):
|
| 390 |
st.session_state.constraints[m]["active"] = False
|
| 391 |
+
# Keep the method in auto_disabled so apply_auto_disable_logic can
|
| 392 |
+
# re-enable it (and fire just_activated) once the resource is added.
|
| 393 |
+
auto_disabled.add(m)
|
| 394 |
st.session_state.pop(f"toggle_{m}", None)
|
| 395 |
st.session_state.pop(f"cap_type_{m}", None)
|
| 396 |
st.session_state.pop(f"slider_{m}", None)
|