Spaces:
Running
Running
Debug - Notifications
Browse files- app/main.py +5 -4
app/main.py
CHANGED
@@ -232,13 +232,14 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
232 |
every=1
|
233 |
)
|
234 |
|
235 |
-
# Function to update the notification display based on the state
|
236 |
def update_notification_ui(notif_list_state):
|
237 |
-
# <<< Add Logging >>>
|
238 |
# notif_list_state here *is* the Python list from the gr.State object
|
239 |
-
|
|
|
|
|
240 |
# Join the list items into a string for display
|
241 |
-
|
|
|
242 |
|
243 |
notification_display.change( # Use .change with every= setup on the component
|
244 |
fn=update_notification_ui,
|
|
|
232 |
every=1
|
233 |
)
|
234 |
|
|
|
235 |
def update_notification_ui(notif_list_state):
|
|
|
236 |
# notif_list_state here *is* the Python list from the gr.State object
|
237 |
+
log_msg = f"UI Update Triggered. State List Length: {len(notif_list_state)}. Content: {notif_list_state[:5]}"
|
238 |
+
logger.debug(log_msg) # Keep logging
|
239 |
+
# --- Ensure we return an update object ---
|
240 |
# Join the list items into a string for display
|
241 |
+
new_value = "\n".join(notif_list_state)
|
242 |
+
return gr.update(value=new_value) # Explicitly return gr.update()
|
243 |
|
244 |
notification_display.change( # Use .change with every= setup on the component
|
245 |
fn=update_notification_ui,
|