Hello,
I am making a sort of guessing game, and I am basically keeping a cache of the random data selected. After 15 incorrect guesses I am giving the option to give up and basically go to the next random selection. My problem I am having is that when I click the give up button, the text bar will be cleared as it should, but then the user would have to click the give up button once again for it to actually go to the next random data item
Code snippet:
def clear_text():
st.session_state["text"] = ""
if st.session_state.wrong >= 15:
if st.button("Give up?", on_click=clear_text):
# st.session_state.give_up = True
st.cache_data.clear()
st.session_state.wrong = 0
# st.session_state.give_up = False
Any help in the right direction is appreciated!