🍭 Updates the event socket url to be dynamic

This commit is contained in:
Rune Harlyk
2024-08-24 21:06:01 +02:00
committed by Rune Harlyk
parent 2d6466050b
commit bbd7d75b92
+3 -2
View File
@@ -20,7 +20,8 @@
outControllerData,
servoAngles,
servoAnglesOut,
socket
socket,
location
} from '$lib/stores';
import type { Analytics, Battery, DownloadOTA } from '$lib/types/models';
import { api } from '$lib/api';
@@ -33,7 +34,7 @@
await validateUser($user);
}
const ws_token = $features.security ? '?access_token=' + $user.bearer_token : '';
socket.init(`ws://${window.location.host}/ws/events${ws_token}`);
socket.init(`ws://${$location}/ws/events${ws_token}`);
addEventListeners();