fix(*): Ensure new partykit url is respected

This commit is contained in:
Josh Creek
2026-01-25 19:38:37 +00:00
parent c1eeb3ccf0
commit e5041d847e
+5 -2
View File
@@ -6,14 +6,17 @@ function generateId() {
return id;
}
const partyHost = import.meta.env.PUBLIC_PARTYKIT_HOST;
const partyHost = import.meta.env.PUBLIC_PARTYKIT_HOST?.trim();
const partyName = import.meta.env.PUBLIC_PARTYKIT_PARTY || 'main';
function getPartyKitHost() {
if (partyHost) {
return partyHost;
}
return import.meta.env.DEV ? 'localhost:1999' : 'websocket.jcreek.co.uk';
if (import.meta.env.DEV) {
return 'localhost:1999';
}
throw new Error('PUBLIC_PARTYKIT_HOST is not set for this build.');
}
function connectToWebSocket(roomId, onMessageReceived) {