From c0ead10b2fd651c94c9c173a54dcf8f451030fed Mon Sep 17 00:00:00 2001 From: Drikus Roor Date: Thu, 7 Mar 2024 16:13:36 +0100 Subject: [PATCH] fix: Allow other query parameters than participant_id in experiment url (#839) --- frontend/src/components/App/App.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/App/App.js b/frontend/src/components/App/App.js index 4b62ae322..1d6011b5e 100644 --- a/frontend/src/components/App/App.js +++ b/frontend/src/components/App/App.js @@ -24,8 +24,8 @@ const App = () => { const queryParams = window.location.search; useEffect(() => { - if (queryParams && !(new URLSearchParams(queryParams).has("participant_id"))) { - setError("Unknown URL parameter, use ?participant_id="); + const urlParams = new URLSearchParams(queryParams); + if (!urlParams.has("participant_id")) { return; } try { @@ -34,7 +34,7 @@ const App = () => { }); } catch (err) { console.error(err); - setError(err); + setError('Could not load participant'); } }, [setError, queryParams, setParticipant])