Spaces:
Runtime error
Runtime error
Tristan Thrush
commited on
Commit
•
a081a7c
1
Parent(s):
1a787c7
fix for double dataset select bug
Browse files
app.py
CHANGED
@@ -141,10 +141,13 @@ st.markdown(
|
|
141 |
|
142 |
all_datasets = [d.id for d in list_datasets()]
|
143 |
query_params = st.experimental_get_query_params()
|
|
|
|
|
|
|
144 |
default_dataset = all_datasets[0]
|
145 |
-
if "dataset" in
|
146 |
-
if len(
|
147 |
-
default_dataset =
|
148 |
|
149 |
selected_dataset = st.selectbox(
|
150 |
"Select a dataset",
|
|
|
141 |
|
142 |
all_datasets = [d.id for d in list_datasets()]
|
143 |
query_params = st.experimental_get_query_params()
|
144 |
+
if "first_query_params" not in st.session_state:
|
145 |
+
st.session_state.first_query_params = query_params
|
146 |
+
first_query_params = st.session_state.first_query_params
|
147 |
default_dataset = all_datasets[0]
|
148 |
+
if "dataset" in first_query_params:
|
149 |
+
if len(first_query_params["dataset"]) > 0 and first_query_params["dataset"][0] in all_datasets:
|
150 |
+
default_dataset = first_query_params["dataset"][0]
|
151 |
|
152 |
selected_dataset = st.selectbox(
|
153 |
"Select a dataset",
|