1
0
mirror of https://github.com/SuperBFG7/ympd synced 2024-06-22 21:03:13 +00:00

Fix: cancel websockettimeout before new one is initiated

This commit is contained in:
jcorporation 2019-01-19 08:55:48 +00:00
parent 535595c7f8
commit ccc0b2e640

View File

@ -39,6 +39,7 @@ var deferredPrompt;
var dragEl;
var playlistEl;
var websocketConnected = false;
var websocketTimer = null;
var appInited = false;
var app = {};
@ -1133,7 +1134,10 @@ function webSocketConnect() {
modalConnectionError.show();
}
websocketConnected = false;
setTimeout(function() {
if (websocketTimer != null) {
clearTimeout(websocketTimer);
}
websocketTimer = setTimeout(function() {
console.log('Reconnecting websocket');
webSocketConnect();
}, 3000);