cordova-plugin-mqtt-pahojs
Advanced tools
Comparing version 1.5.4 to 1.5.5
{ | ||
"name": "cordova-plugin-mqtt-pahojs", | ||
"cordova_name": "MQTT JavaScript Client", | ||
"version": "1.5.4", | ||
"version": "1.5.5", | ||
"description": "Pure JavaScript MQTT client library. Wrapper for paho.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
@@ -44,4 +44,11 @@ var Paho = require('./paho_mqttws31'); | ||
if (this.connection) { | ||
this.connection.onConnectionLost = function(){console.debug('stale onConnectionLost called');}; | ||
this.connection.onMessageArrived = function(){console.debug('stale onMessageArrived called');}; | ||
try { | ||
this.connection.onConnectionLost = function() { | ||
console.debug('stale onConnectionLost called'); | ||
}; | ||
this.connection.onMessageArrived = function() { | ||
console.debug('stale onMessageArrived called'); | ||
}; | ||
this.connection.isConnected() && this.connection.disconnect(); | ||
} catch (e) {} | ||
} | ||
@@ -169,3 +176,2 @@ this.connection = new Paho.MQTT.Client(this.uri, this.clientId); | ||
console.error('Error disconnecting, cause: ' + (e ? (e.message || e.errorMessage) : 'unknown reason')); | ||
} finally { | ||
@@ -172,0 +178,0 @@ setTimeout(_connect.bind(this), 0); |
96886
2216