Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -72,11 +72,13 @@ if not st.session_state.initialized:
|
|
72 |
except Exception as e:
|
73 |
init_message.error(f"Error initializing: {str(e)}")
|
74 |
|
75 |
-
|
76 |
-
|
77 |
-
|
|
|
|
|
78 |
init_message.empty()
|
79 |
-
st.session_state.init_time = None
|
80 |
|
81 |
# Function to handle form submission
|
82 |
def handle_form_submit():
|
|
|
72 |
except Exception as e:
|
73 |
init_message.error(f"Error initializing: {str(e)}")
|
74 |
|
75 |
+
# Handle timing of success message disappearance
|
76 |
+
# This will run on each rerender after initialization
|
77 |
+
if st.session_state.initialized and st.session_state.init_time:
|
78 |
+
current_time = time.time()
|
79 |
+
if (current_time - st.session_state.init_time) >= 2.0:
|
80 |
init_message.empty()
|
81 |
+
st.session_state.init_time = None # Reset the time after clearing
|
82 |
|
83 |
# Function to handle form submission
|
84 |
def handle_form_submit():
|