Raj Jayendrakumar Muchhala commited on
Commit
debb8ec
·
1 Parent(s): 4377407

delete functionality

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -149,9 +149,14 @@ with col_output:
149
 
150
  # Button to delete this clip plan
151
  if st.button("Delete Clip", key=f"delete_{i}"):
152
- updated_clip_plans.pop(i)
 
 
 
 
153
  st.session_state.clip_plans = updated_clip_plans
154
- st.experimental_rerun()
 
155
 
156
  # Button for transcript extraction for this clip
157
  if st.button("Extract Transcript", key=f"extract_{i}"):
 
149
 
150
  # Button to delete this clip plan
151
  if st.button("Delete Clip", key=f"delete_{i}"):
152
+ # Create a copy of the clip plans list
153
+ updated_clip_plans = st.session_state.clip_plans.copy()
154
+ # Remove the clip at index `i`
155
+ del updated_clip_plans[i]
156
+ # Update session state with the modified list
157
  st.session_state.clip_plans = updated_clip_plans
158
+ # Rerun the app to reflect the changes
159
+ st.rerun()
160
 
161
  # Button for transcript extraction for this clip
162
  if st.button("Extract Transcript", key=f"extract_{i}"):