diff --git a/static/client.js b/static/client.js index 2cb0b33..a40699d 100644 --- a/static/client.js +++ b/static/client.js @@ -15,10 +15,6 @@ function viv_scrollTo(value) { const ws = new WebSocket(`ws://localhost:${window.VIV_PORT}`); -ws.addEventListener('open', () => { - ws.send(`PATH: ${window.VIV_PATH}`); -}); - ws.addEventListener('message', (event) => { const fields = event.data.toString().split(': '); if (fields.length < 2) return; @@ -40,3 +36,7 @@ ws.addEventListener('message', (event) => { break; } }); + +ws.addEventListener('open', () => { + ws.send(`PATH: ${window.VIV_PATH}`); +});