mirror of
https://github.com/SuperBFG7/ympd
synced 2024-11-05 14:26:16 +00:00
Fix: show no connection error modal, if app is not initialized
This commit is contained in:
parent
2f3a579d07
commit
597268aca6
@ -619,7 +619,7 @@
|
||||
</footer>
|
||||
|
||||
<!-- Modals -->
|
||||
<div class="modal fade" id="modalAppInit" tabindex="-1">
|
||||
<div class="modal" id="modalAppInit" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header bg-success text-light">
|
||||
|
@ -1048,7 +1048,7 @@ function webSocketConnect() {
|
||||
|
||||
try {
|
||||
socket.onopen = function() {
|
||||
console.log('connected');
|
||||
console.log('Websocket is connected');
|
||||
showNotification('Connected to myMPD: ' + wsUrl, '', '', 'success');
|
||||
modalConnectionError.hide();
|
||||
appRoute();
|
||||
@ -1111,11 +1111,14 @@ function webSocketConnect() {
|
||||
}
|
||||
|
||||
socket.onclose = function(){
|
||||
console.log('Websocket is disconnected');
|
||||
if (websocketConnected == true) {
|
||||
//Show modal only if websocket was already connected before
|
||||
modalConnectionError.show();
|
||||
}
|
||||
websocketConnected = false;
|
||||
console.log('disconnected');
|
||||
modalConnectionError.show();
|
||||
setTimeout(function() {
|
||||
console.log('reconnect');
|
||||
console.log('Reconnecting websocket');
|
||||
webSocketConnect();
|
||||
}, 3000);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user