Spaces:
Sleeping
Sleeping
Claude Code commited on
Commit ·
86389f0
1
Parent(s): 8bb095e
fix: add error handling to toggle_system_status
Browse files
app.py
CHANGED
|
@@ -343,10 +343,14 @@ def reset_session():
|
|
| 343 |
|
| 344 |
def toggle_system_status() -> tuple[bool, str]:
|
| 345 |
"""Toggle system status visibility."""
|
| 346 |
-
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 350 |
|
| 351 |
|
| 352 |
def export_chat(history: list, format_type: str = "txt") -> str:
|
|
|
|
| 343 |
|
| 344 |
def toggle_system_status() -> tuple[bool, str]:
|
| 345 |
"""Toggle system status visibility."""
|
| 346 |
+
try:
|
| 347 |
+
global _system_status_visible
|
| 348 |
+
_system_status_visible = not _system_status_visible
|
| 349 |
+
status_text = "✅ System details shown" if _system_status_visible else "🔒 System details hidden"
|
| 350 |
+
return _system_status_visible, status_text
|
| 351 |
+
except Exception as e:
|
| 352 |
+
logger.error(f"[TOGGLE_ERROR] Failed to toggle status: {e}")
|
| 353 |
+
return False, f"Error: {e}"
|
| 354 |
|
| 355 |
|
| 356 |
def export_chat(history: list, format_type: str = "txt") -> str:
|