XPMaster commited on
Commit
8b441c9
·
1 Parent(s): 248a5eb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
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, disabled if no file has been uploaded
51
  with button_col1:
52
- # The button is enabled if a file has been uploaded, otherwise it's disabled
53
- if st.button(premiumlabel, disabled=uploaded_file_premiums is None, key=premiumlabel):
54
- # If the button is active and clicked, call the callback function
 
 
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: