diff --git a/api/utils/socket.ts b/api/utils/socket.ts index ab981fa..8f8cfdd 100644 --- a/api/utils/socket.ts +++ b/api/utils/socket.ts @@ -23,7 +23,7 @@ const send = (body) => { // connections.forEach((socket, index) => { // socket.send(body) // }) - lastConn.send(body) + if(lastConn) lastConn.send(body) } const sendJson = (object) => { diff --git a/config/app.json b/config/app.json index 41833c8..887cdf3 100644 --- a/config/app.json +++ b/config/app.json @@ -12,7 +12,7 @@ "hub_invite_url": "http://lvh.me/invites", "hub_check_invite_url": "http://lvh.me/check_invite", "media_host": "localhost:5000", - "tribes_host": "tribes.sphinx.chat:1883" + "tribes_host": "127.0.0.1:1883" }, "production": { "senza_url": "https://staging.senza.us/api/v2/", diff --git a/dist/api/utils/socket.js b/dist/api/utils/socket.js index 0bc1587..41b041f 100644 --- a/dist/api/utils/socket.js +++ b/dist/api/utils/socket.js @@ -19,7 +19,8 @@ const send = (body) => { // connections.forEach((socket, index) => { // socket.send(body) // }) - lastConn.send(body); + if (lastConn) + lastConn.send(body); }; exports.send = send; const sendJson = (object) => { diff --git a/dist/api/utils/socket.js.map b/dist/api/utils/socket.js.map index 1ee86a1..e559fd2 100644 --- a/dist/api/utils/socket.js.map +++ b/dist/api/utils/socket.js.map @@ -1 +1 @@ -{"version":3,"file":"socket.js","sourceRoot":"","sources":["../../../api/utils/socket.ts"],"names":[],"mappings":";;AAAA,gCAA+B;AAE/B,8BAA8B;AAC9B,4BAA4B;AAE5B,IAAI,QAAa,CAAA;AAEjB,MAAM,OAAO,GAAG,CAAC,MAAM,EAAE,EAAE;IACzB,MAAM,GAAG,IAAI,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAA;IAEzC,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAA;IAE9C,MAAM,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,CAAC,EAAE;QAC/B,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAA;QAC9C,gCAAgC;QAChC,8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,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAA;AAC9B,CAAC,CAAA;AAKC,4BAAQ"} \ No newline at end of file