From 32e0c93b7ddfbe615983d2fcac40b4f916e0ee72 Mon Sep 17 00:00:00 2001 From: Mawoka Date: Sun, 6 Nov 2022 15:28:02 +0100 Subject: [PATCH] :bug: Fixed play-screen when joining via the QR-code --- frontend/src/lib/play/join.svelte | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/frontend/src/lib/play/join.svelte b/frontend/src/lib/play/join.svelte index 4b578df..0ae9d12 100644 --- a/frontend/src/lib/play/join.svelte +++ b/frontend/src/lib/play/join.svelte @@ -54,7 +54,16 @@ }); const set_game_pin = async () => { - const res = await fetch(`/api/v1/quiz/play/check_captcha/${game_pin}`); + let process_var; + try { + process_var = process; + } catch { + process_var = { env: { API_URL: undefined } }; + } + + const res = await fetch( + `${process_var.env.API_URL ?? ''}/api/v1/quiz/play/check_captcha/${game_pin}` + ); const json = await res.json(); game_mode = json.game_mode; if (res.status === 200) {