From 4ed51b922d68e847df79fdd4cb20d50d24be7df4 Mon Sep 17 00:00:00 2001 From: whatdoineed2do/Ray Date: Sat, 30 Dec 2023 17:31:51 +0000 Subject: [PATCH] ray: [web-src] reconnecting ws #1446 --- web-src.v3/package.json | 2 +- web-src.v3/src/App.vue | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/web-src.v3/package.json b/web-src.v3/package.json index 55cfd5e11c..86b878d35a 100644 --- a/web-src.v3/package.json +++ b/web-src.v3/package.json @@ -21,7 +21,7 @@ "luxon": "^3.4.4", "mdi-vue": "^3.0.13", "mdi-vue3": "^7.2.96", - "reconnectingwebsocket": "^1.0.0", + "reconnecting-websocket": "^4.4.0", "spotify-web-api-js": "^1.5.2", "string-to-color": "^2.2.2", "vue": "^3.3.8", diff --git a/web-src.v3/src/App.vue b/web-src.v3/src/App.vue index 7f9c78ffa0..db914b750a 100644 --- a/web-src.v3/src/App.vue +++ b/web-src.v3/src/App.vue @@ -32,7 +32,7 @@ import ModalDialogRemotePairing from '@/components/ModalDialogRemotePairing.vue' import ModalDialogUpdate from '@/components/ModalDialogUpdate.vue' import webapi from '@/webapi' import * as types from '@/store/mutation_types' -import ReconnectingWebSocket from 'reconnectingwebsocket' +import ReconnectingWebSocket from 'reconnecting-websocket' export default { name: 'App', @@ -178,8 +178,8 @@ export default { } const socket = new ReconnectingWebSocket(wsUrl, 'notify', { - reconnectInterval: 1000, - maxReconnectInterval: 2000 + minReconnectionDelay: 1000, + maxReconnectionDelay: 2000 }) socket.onopen = function () { @@ -244,6 +244,8 @@ export default { return } + socket.reconnect() + vm.update_outputs() vm.update_player_status() vm.update_library_stats()