mirror of
https://github.com/SuperBFG7/ympd
synced 2025-10-01 00:12:23 +00:00
Fix: cancel websockettimeout before new one is initiated
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user