From d903bd5a1c6d449cead35df8d337cc0a859c8bd1 Mon Sep 17 00:00:00 2001 From: Rune Harlyk Date: Mon, 26 Aug 2024 18:15:32 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=83=8F=20Makes=20layout=20connect=20to=20?= =?UTF-8?q?event=20socket=20correctly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/routes/+layout.svelte | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/routes/+layout.svelte b/app/src/routes/+layout.svelte index 4e2dcc7..3d71c47 100644 --- a/app/src/routes/+layout.svelte +++ b/app/src/routes/+layout.svelte @@ -34,7 +34,8 @@ await validateUser($user); } const ws_token = $features.security ? '?access_token=' + $user.bearer_token : ''; - socket.init(`ws://${$location}/ws/events${ws_token}`); + const ws = $location ? $location : window.location.host; + socket.init(`ws://${ws}/ws/events${ws_token}`); addEventListeners();