Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -66,11 +66,11 @@ if st.session_state.appliances:
|
|
| 66 |
|
| 67 |
# Remove Appliance Option
|
| 68 |
remove_index = st.number_input(
|
| 69 |
-
"Enter the row number to remove an appliance (starting from
|
| 70 |
)
|
| 71 |
remove_button = st.button("Remove Appliance")
|
| 72 |
if remove_button:
|
| 73 |
-
if
|
| 74 |
del st.session_state.appliances[remove_index]
|
| 75 |
st.success("Appliance removed successfully!")
|
| 76 |
else:
|
|
|
|
| 66 |
|
| 67 |
# Remove Appliance Option
|
| 68 |
remove_index = st.number_input(
|
| 69 |
+
"Enter the row number to remove an appliance (starting from 1):", min_value=0, max_value=len(appliances_df)-1, step=1
|
| 70 |
)
|
| 71 |
remove_button = st.button("Remove Appliance")
|
| 72 |
if remove_button:
|
| 73 |
+
if 1 <= remove_index < len(st.session_state.appliances):
|
| 74 |
del st.session_state.appliances[remove_index]
|
| 75 |
st.success("Appliance removed successfully!")
|
| 76 |
else:
|