Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -47,11 +47,13 @@ def process_premiums_file(uploaded_file):
|
|
| 47 |
# Indicate that the CSV has been processed and we're ready to select columns
|
| 48 |
st.session_state['select_columns'] = True
|
| 49 |
|
| 50 |
-
# Button to select premiums,
|
| 51 |
with button_col1:
|
| 52 |
-
#
|
| 53 |
-
|
| 54 |
-
|
|
|
|
|
|
|
| 55 |
process_premiums_file(uploaded_file_premiums)
|
| 56 |
|
| 57 |
with button_col2:
|
|
|
|
| 47 |
# Indicate that the CSV has been processed and we're ready to select columns
|
| 48 |
st.session_state['select_columns'] = True
|
| 49 |
|
| 50 |
+
# Button to select premiums, only displayed and active if a file has been uploaded
|
| 51 |
with button_col1:
|
| 52 |
+
# Check if the file has been uploaded
|
| 53 |
+
file_uploaded = uploaded_file_premiums is not None
|
| 54 |
+
# The button is enabled if a file has been uploaded, and disabled otherwise
|
| 55 |
+
if st.button(premiumlabel, disabled=not file_uploaded, key="premiums_button"):
|
| 56 |
+
# If the button is clicked (active), call the callback function
|
| 57 |
process_premiums_file(uploaded_file_premiums)
|
| 58 |
|
| 59 |
with button_col2:
|