🃏 Makes layout connect to event socket correctly

This commit is contained in:
Rune Harlyk
2024-08-26 18:15:32 +02:00
committed by Rune Harlyk
parent fb8ee64ee4
commit d903bd5a1c
+2 -1
View File
@@ -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();