diff options
| -rw-r--r-- | .env | 1 | ||||
| -rw-r--r-- | .env.production | 1 | ||||
| -rw-r--r-- | src/components/Qr.svelte | 2 | ||||
| -rw-r--r-- | src/lib/socket.js | 4 |
4 files changed, 6 insertions, 2 deletions
@@ -1,2 +1,3 @@ VITE_COINOS_URL=http://localhost:3119 VITE_BTC=5ac9f65c0efcc4775e0baec4ec03abdde22473cd3cf33c0419ca290e0751b225 +VITE_SOCKET=ws://localhost:3119/ws diff --git a/.env.production b/.env.production index f9924dad..8c4c1427 100644 --- a/.env.production +++ b/.env.production @@ -1,2 +1,3 @@ VITE_COINOS_URL=http://localhost:3119 VITE_BTC=5ac9f65c0efcc4775e0baec4ec03abdde22473cd3cf33c0419ca290e0751b225 +VITE_SOCKET=wss://v2.coinos.io/ws diff --git a/src/components/Qr.svelte b/src/components/Qr.svelte index 4929137a..51616eac 100644 --- a/src/components/Qr.svelte +++ b/src/components/Qr.svelte @@ -29,7 +29,7 @@ while (qr.firstChild) qr.removeChild(qr.lastChild); qrCode.append(qr); - } + }; </script> <div bind:this={qr} on:click={() => copy(text)} /> diff --git a/src/lib/socket.js b/src/lib/socket.js index e85e8f15..ee8883b0 100644 --- a/src/lib/socket.js +++ b/src/lib/socket.js @@ -2,6 +2,8 @@ import { get } from 'svelte/store'; import { rate, user, token, invoices, newPayment } from '$lib/store'; import { success } from '$lib/utils'; +const socketUrl = import.meta.env.VITE_SOCKET; + let interval, socket; export const auth = () => { @@ -45,7 +47,7 @@ export function connect() { if (socket) return auth(); - socket = new WebSocket('ws://localhost:3119/ws'); + socket = new WebSocket(socketUrl); socket.addEventListener('open', onWebsocketOpen); socket.addEventListener('close', onWebsocketClose); socket.addEventListener('message', onWebsocketMessage); |
