mirror of
https://github.com/SuperBFG7/ympd
synced 2024-09-28 06:18:13 +00:00
Fix: cancel websockettimeout before new one is initiated
This commit is contained in:
parent
535595c7f8
commit
ccc0b2e640
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user