Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -332,6 +332,7 @@ def main_app():
|
|
332 |
if st.session_state.images_data == [] or st.session_state.load_more_pressed == True:
|
333 |
if st.session_state.load_more_pressed == True:
|
334 |
st.session_state.start_index += st.session_state.batch_size
|
|
|
335 |
# load all images if new login or load_more is pressed, also reset the flag
|
336 |
st.session_state.images_data = load_image_data(st.session_state.current_user, st.session_state.start_index, st.session_state.batch_size)
|
337 |
st.session_state.load_more_pressed = False
|
@@ -360,7 +361,6 @@ def main_app():
|
|
360 |
# Logout button
|
361 |
if st.button("Logout", on_click=logout_callback):
|
362 |
pass
|
363 |
-
|
364 |
# Render the appropriate screen based on login status
|
365 |
if st.session_state.logged_in:
|
366 |
main_app()
|
|
|
332 |
if st.session_state.images_data == [] or st.session_state.load_more_pressed == True:
|
333 |
if st.session_state.load_more_pressed == True:
|
334 |
st.session_state.start_index += st.session_state.batch_size
|
335 |
+
st.session_state.images_data = [] # Clear the images data when load more is pressed
|
336 |
# load all images if new login or load_more is pressed, also reset the flag
|
337 |
st.session_state.images_data = load_image_data(st.session_state.current_user, st.session_state.start_index, st.session_state.batch_size)
|
338 |
st.session_state.load_more_pressed = False
|
|
|
361 |
# Logout button
|
362 |
if st.button("Logout", on_click=logout_callback):
|
363 |
pass
|
|
|
364 |
# Render the appropriate screen based on login status
|
365 |
if st.session_state.logged_in:
|
366 |
main_app()
|