Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -226,7 +226,8 @@ def display_pet_card(pet, is_favorite=False):
|
|
226 |
with col1:
|
227 |
if st.button("View Details", key=f"details_{pet['id']}"):
|
228 |
st.session_state.selected_pet = pet['id']
|
229 |
-
st.stop()
|
|
|
230 |
with col2:
|
231 |
if not is_favorite:
|
232 |
if st.button("Add to Favorites", key=f"fav_{pet['id']}"):
|
@@ -291,11 +292,10 @@ def display_pet_details(pet_id):
|
|
291 |
return
|
292 |
|
293 |
# Back button
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
|
298 |
-
|
299 |
# Pet name and status
|
300 |
st.markdown(f"<h1 class='main-header'>{pet['name']}</h1>", unsafe_allow_html=True)
|
301 |
|
|
|
226 |
with col1:
|
227 |
if st.button("View Details", key=f"details_{pet['id']}"):
|
228 |
st.session_state.selected_pet = pet['id']
|
229 |
+
st.experimental_rerun() # <-- replace st.stop() with this
|
230 |
+
|
231 |
with col2:
|
232 |
if not is_favorite:
|
233 |
if st.button("Add to Favorites", key=f"fav_{pet['id']}"):
|
|
|
292 |
return
|
293 |
|
294 |
# Back button
|
295 |
+
if st.button("← Back to Search Results"):
|
296 |
+
st.session_state.selected_pet = None
|
297 |
+
st.experimental_rerun() # <-- replace st.stop() with this
|
298 |
|
|
|
299 |
# Pet name and status
|
300 |
st.markdown(f"<h1 class='main-header'>{pet['name']}</h1>", unsafe_allow_html=True)
|
301 |
|