Spaces:
Runtime error
Runtime error
Benjamin Bossan
commited on
Commit
·
f1e583c
1
Parent(s):
af69d1f
Bugfix: deleting parent section deletes child too
Browse files
app.py
CHANGED
|
@@ -47,7 +47,14 @@ def _clear_custom_section_cache():
|
|
| 47 |
|
| 48 |
|
| 49 |
def _remove_custom_section(key):
|
| 50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
|
| 53 |
def _clear_repo(path):
|
|
|
|
| 47 |
|
| 48 |
|
| 49 |
def _remove_custom_section(key):
|
| 50 |
+
section_names = list(st.session_state.custom_sections.keys())
|
| 51 |
+
for section_name in section_names:
|
| 52 |
+
if (
|
| 53 |
+
(section_name == key)
|
| 54 |
+
or section_name.startswith(key + "/")
|
| 55 |
+
or section_name.startswith(key + " /")
|
| 56 |
+
):
|
| 57 |
+
del st.session_state.custom_sections[section_name]
|
| 58 |
|
| 59 |
|
| 60 |
def _clear_repo(path):
|