fix: Force closing the connection before trying to reconnect

diagnosticTool
mokaddem 2019-06-19 11:45:43 +02:00
parent c1a2d17bbf
commit 194b28ea93
1 changed files with 2 additions and 1 deletions

View File

@ -23,7 +23,7 @@ class MapEvent {
this.specifName = json.specifName;
this.cityName = json.cityName;
this.text = this.categ + ": " + this.value;
let underText = "";
let underText = "";
if (this.specifName !== null && this.cityName !== null) {
underText = this.specifName+", "+this.cityName;
} else if (this.specifName !== null) {
@ -225,6 +225,7 @@ function connect_source_map() {
};
source_map.onerror = function(){
console.log('error: '+source_map.readyState);
source_map.close()
setTimeout(function() { connect_source_map(); }, 5000);
};
}