Skip to content

Commit

Permalink
Clear the network field if the user changes the client settings #151
Browse files Browse the repository at this point in the history
  • Loading branch information
NTaherifar committed Nov 18, 2024
1 parent fd965a0 commit a4276e0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions seed_vault/ui/components/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,16 @@ def station_filter(self):
with st.expander("### Filters", expanded=True):
client_options = list(self.settings.client_url_mapping.keys())
try:
previous_client = self.settings.station.client
self.settings.station.client = st.selectbox(
'Choose a client:', client_options,
index=client_options.index(self.settings.station.client),
key="event-pg-client-station"
)
if self.settings.station.client != previous_client:
self.settings.station.network = ""
st.session_state["event-pg-net-txt-station"] = self.settings.station.network

except ValueError as e:
st.error(f"Error: {str(e)}. Station client is set to {self.settings.station.client}, which seems does not exists. Please navigate to the settings page and use the Clients tab to add the client or fix the stored config.cfg file.")

Expand Down

0 comments on commit a4276e0

Please sign in to comment.