From 1633db793b6059076015c5f0c60d05161e4d9ee9 Mon Sep 17 00:00:00 2001 From: Christoph Stahl Date: Sun, 4 Dec 2022 02:59:30 +0100 Subject: [PATCH] Better reconnect handling --- src/App.vue | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/App.vue b/src/App.vue index bb3cf7b..e905f79 100644 --- a/src/App.vue +++ b/src/App.vue @@ -101,6 +101,12 @@ function registerSocketEvents(socket) { socket.on("connect", () => { joinRoom() }) + socket.io.on("reconnect", () => { joinRoom() }) + + socket.on("disconnect", () => { + connect(); + }); + socket.on("state", (val) => { state.value.queue=val.queue state.value.recent=val.recent @@ -129,6 +135,7 @@ function joinRoom() { "install Syng and run it with
syng-client " + 
                 state.value.server + "
" + state.socket.disconnect() } }) }