Button not disappearing when the page refreshes with long-running function

I always dislike having to go for the workaround, but sometimes st.empty() needs a little moment to “take” on the front end:

import streamlit as st
import time

print('App-rerun')


if st.session_state.get('btn_run', False):
    with st.empty():
        time.sleep(.1) # A fraction of a second for the empty to "take"
        with st.container():
            progress = st.progress(0)
            for i in range(5):
                progress.progress((i+1)/5)
                time.sleep(1)
            st.write('Done')
else:
    with st.container():
        st.write('Lots of text')
        st.write('More text here')
        btn_run = st.button('Run', key='btn_run')