awacke1 commited on
Commit
bfd3eaf
1 Parent(s): f075917

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -149,9 +149,9 @@ else:
149
 
150
  # Handle component interactions
151
  if component_value:
152
- action = component_value.get('action')
153
- record_id = component_value.get('id')
154
- if action and record_id:
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)