Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -159,6 +159,7 @@ elif menu == "Current":
|
|
| 159 |
if st.button("Submit Summary to History"):
|
| 160 |
timestamp = save_summary_to_history()
|
| 161 |
st.success(f"Summary saved to history at {timestamp}")
|
|
|
|
| 162 |
os.remove(TEMP_FILE)
|
| 163 |
upload_temp_file_to_repo()
|
| 164 |
st.experimental_set_query_params(step="reset")
|
|
@@ -166,6 +167,8 @@ elif menu == "Current":
|
|
| 166 |
# History view to check past summaries
|
| 167 |
elif menu == "History":
|
| 168 |
st.title("Breakfast Poll History")
|
|
|
|
|
|
|
| 169 |
if st.session_state.history:
|
| 170 |
for record in st.session_state.history:
|
| 171 |
st.subheader(f"Date: {record['Date']}")
|
|
|
|
| 159 |
if st.button("Submit Summary to History"):
|
| 160 |
timestamp = save_summary_to_history()
|
| 161 |
st.success(f"Summary saved to history at {timestamp}")
|
| 162 |
+
st.session_state.history = load_history() # Reload history after saving
|
| 163 |
os.remove(TEMP_FILE)
|
| 164 |
upload_temp_file_to_repo()
|
| 165 |
st.experimental_set_query_params(step="reset")
|
|
|
|
| 167 |
# History view to check past summaries
|
| 168 |
elif menu == "History":
|
| 169 |
st.title("Breakfast Poll History")
|
| 170 |
+
if not st.session_state.history:
|
| 171 |
+
st.session_state.history = load_history() # Reload history if it's empty
|
| 172 |
if st.session_state.history:
|
| 173 |
for record in st.session_state.history:
|
| 174 |
st.subheader(f"Date: {record['Date']}")
|