Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -149,9 +149,9 @@ else:
|
|
| 149 |
|
| 150 |
# Handle component interactions
|
| 151 |
if component_value:
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
if action == 'extend':
|
| 156 |
st.write(f"Extending record {record_id}")
|
| 157 |
elif action == 'toggle_public':
|
|
@@ -160,6 +160,8 @@ else:
|
|
| 160 |
st.write(f"Liked record {record_id}")
|
| 161 |
elif action == 'dislike':
|
| 162 |
st.write(f"Disliked record {record_id}")
|
|
|
|
|
|
|
| 163 |
|
| 164 |
# Add delete and download buttons
|
| 165 |
col1, col2 = st.columns(2)
|
|
|
|
| 149 |
|
| 150 |
# Handle component interactions
|
| 151 |
if component_value:
|
| 152 |
+
try:
|
| 153 |
+
action = component_value['action']
|
| 154 |
+
record_id = component_value['id']
|
| 155 |
if action == 'extend':
|
| 156 |
st.write(f"Extending record {record_id}")
|
| 157 |
elif action == 'toggle_public':
|
|
|
|
| 160 |
st.write(f"Liked record {record_id}")
|
| 161 |
elif action == 'dislike':
|
| 162 |
st.write(f"Disliked record {record_id}")
|
| 163 |
+
except KeyError:
|
| 164 |
+
st.write("Interaction detected, but action or id not found.")
|
| 165 |
|
| 166 |
# Add delete and download buttons
|
| 167 |
col1, col2 = st.columns(2)
|