Spaces:
Sleeping
Sleeping
debug
Browse files- app/main.py +14 -0
app/main.py
CHANGED
|
@@ -229,6 +229,20 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
| 229 |
every=1
|
| 230 |
)
|
| 231 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 232 |
# --- Event Handlers ---
|
| 233 |
|
| 234 |
# Registration Logic
|
|
|
|
| 229 |
every=1
|
| 230 |
)
|
| 231 |
|
| 232 |
+
# Function to update the notification display based on the state
|
| 233 |
+
def update_notification_ui(notif_list_state):
|
| 234 |
+
# <<< Add Logging >>>
|
| 235 |
+
# notif_list_state here *is* the Python list from the gr.State object
|
| 236 |
+
logger.debug(f"UI Update Triggered. State List Length: {len(notif_list_state)}. Content: {notif_list_state[:5]}")
|
| 237 |
+
# Join the list items into a string for display
|
| 238 |
+
return "\n".join(notif_list_state)
|
| 239 |
+
|
| 240 |
+
notification_display.change( # Use .change with every= setup on the component
|
| 241 |
+
fn=update_notification_ui,
|
| 242 |
+
inputs=[notification_list], # Read the state
|
| 243 |
+
outputs=[notification_display] # Update the component
|
| 244 |
+
)
|
| 245 |
+
|
| 246 |
# --- Event Handlers ---
|
| 247 |
|
| 248 |
# Registration Logic
|