awacke1 commited on
Commit
584bf5b
β€’
1 Parent(s): df4ef99

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -21,13 +21,6 @@ if 'query' not in st.session_state:
21
  else:
22
  query = st.text_input("", value=st.session_state["query"], key="query")
23
 
24
- try:
25
- st.session_state.query = query # if set already above. this prevents two interface elements setting it first time once
26
- except: # catch exception and set query param to predefined value
27
- print("Error cant set after init")
28
- st.experimental_set_query_params(option=selected_option)
29
-
30
-
31
 
32
  # callback to update query param on selectbox change
33
  def update_params():
@@ -51,6 +44,13 @@ if query_params:
51
  selected_option = st.radio(
52
  "Param", options, index=ix, key="query", on_change=update_params
53
  )
 
 
 
 
 
 
 
54
 
55
 
56
  # Text Input, check the query params set the text input to query value if in session
21
  else:
22
  query = st.text_input("", value=st.session_state["query"], key="query")
23
 
 
 
 
 
 
 
 
24
 
25
  # callback to update query param on selectbox change
26
  def update_params():
44
  selected_option = st.radio(
45
  "Param", options, index=ix, key="query", on_change=update_params
46
  )
47
+ st.experimental_set_query_params(option=selected_option)
48
+
49
+
50
+ #try:
51
+ # st.session_state.query = query # if set already above. this prevents two interface elements setting it first time once
52
+ #except: # catch exception and set query param to predefined value
53
+ # print("Error cant set after init")
54
 
55
 
56
  # Text Input, check the query params set the text input to query value if in session