I want my Show more button to display below the components which are rendered in the display_papers()
function.
However, this means that when the num_displayed amount only increases after the papers are displayed. So I have to click the show more button twice before seeing any visual update
Code snippet:
def display_papers():
print("Papers to display: ", st.session_state.num_displayed)
for i in range(st.session_state.num_displayed):
paper = st.session_state.papers[i]
st.write("---")
st.markdown(create_card(paper["authors"], paper["publicationDate"], paper["title"], paper["uri"]), unsafe_allow_html=True)
if len(st.session_state.papers):
display_papers()
if st.button("Show more"):
st.session_state.num_displayed += 5