mirror of
https://github.com/jcreek/EstimationPoker.git
synced 2026-07-13 02:53:46 +00:00
fix(*): Ensure new partykit url is respected
This commit is contained in:
@@ -6,14 +6,17 @@ function generateId() {
|
|||||||
return id;
|
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';
|
const partyName = import.meta.env.PUBLIC_PARTYKIT_PARTY || 'main';
|
||||||
|
|
||||||
function getPartyKitHost() {
|
function getPartyKitHost() {
|
||||||
if (partyHost) {
|
if (partyHost) {
|
||||||
return 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) {
|
function connectToWebSocket(roomId, onMessageReceived) {
|
||||||
|
|||||||
Reference in New Issue
Block a user