James McCool
commited on
Commit
·
5a791bd
1
Parent(s):
5647915
Refactor export button logic in app.py: streamline the addition of portfolios to the export base by replacing the button context with a conditional check, enhancing user interaction and code clarity.
Browse files
app.py
CHANGED
|
@@ -1104,10 +1104,8 @@ with tab2:
|
|
| 1104 |
with download_port:
|
| 1105 |
st.download_button(label="Download Portfolio", data=st.session_state['export_file'].to_csv(index=False), file_name="portfolio.csv", mime="text/csv")
|
| 1106 |
with merge_port:
|
| 1107 |
-
|
| 1108 |
st.session_state['export_base'] = pd.concat([st.session_state['export_base'], st.session_state['export_file']])
|
| 1109 |
-
with blank_export_col:
|
| 1110 |
-
st.button("Clear export portfolio")
|
| 1111 |
else:
|
| 1112 |
st.error("No portfolio to download")
|
| 1113 |
|
|
|
|
| 1104 |
with download_port:
|
| 1105 |
st.download_button(label="Download Portfolio", data=st.session_state['export_file'].to_csv(index=False), file_name="portfolio.csv", mime="text/csv")
|
| 1106 |
with merge_port:
|
| 1107 |
+
if st.button("Add to export"):
|
| 1108 |
st.session_state['export_base'] = pd.concat([st.session_state['export_base'], st.session_state['export_file']])
|
|
|
|
|
|
|
| 1109 |
else:
|
| 1110 |
st.error("No portfolio to download")
|
| 1111 |
|