Spaces:
Running
Running
xhluca
commited on
Commit
•
eeae578
1
Parent(s):
bc2c578
Fix experimental error
Browse files
app.py
CHANGED
@@ -269,12 +269,18 @@ def run():
|
|
269 |
mode = st.sidebar.radio("Mode", ["Overview"])
|
270 |
demonstration_dir = "./demonstrations"
|
271 |
|
272 |
-
params = st.experimental_get_query_params()
|
|
|
|
|
|
|
273 |
# list demonstrations/
|
274 |
demo_names = os.listdir(demonstration_dir)
|
275 |
|
276 |
if params.get("recording"):
|
277 |
-
|
|
|
|
|
|
|
278 |
|
279 |
else:
|
280 |
recording_name = demo_names[0]
|
@@ -286,7 +292,9 @@ def run():
|
|
286 |
)
|
287 |
|
288 |
if recording_name != params.get("recording", [None])[0]:
|
289 |
-
st.experimental_set_query_params(recording=recording_name)
|
|
|
|
|
290 |
|
291 |
if mode == "Overview":
|
292 |
with st.sidebar:
|
|
|
269 |
mode = st.sidebar.radio("Mode", ["Overview"])
|
270 |
demonstration_dir = "./demonstrations"
|
271 |
|
272 |
+
# params = st.experimental_get_query_params()
|
273 |
+
params = st.query_params
|
274 |
+
print(params)
|
275 |
+
|
276 |
# list demonstrations/
|
277 |
demo_names = os.listdir(demonstration_dir)
|
278 |
|
279 |
if params.get("recording"):
|
280 |
+
if isinstance(params["recording"], list):
|
281 |
+
recording_name = params["recording"][0]
|
282 |
+
else:
|
283 |
+
recording_name = params["recording"]
|
284 |
|
285 |
else:
|
286 |
recording_name = demo_names[0]
|
|
|
292 |
)
|
293 |
|
294 |
if recording_name != params.get("recording", [None])[0]:
|
295 |
+
# st.experimental_set_query_params(recording=recording_name)
|
296 |
+
# use st.query_params as a dict instead
|
297 |
+
st.query_params['recording'] = recording_name
|
298 |
|
299 |
if mode == "Overview":
|
300 |
with st.sidebar:
|