Fix network information type exception on fxos 2

This commit is contained in:
Rodrigo Silveira 2014-09-11 13:40:19 -07:00
parent a810b7db99
commit ec96704786

View File

@ -34,8 +34,16 @@ module.exports = {
getConnectionInfo: function(successCallback, errorCallback) {
var connection = origConnection || navigator.mozConnection,
connectionType = Connection.UNKNOWN,
bandwidth = connection.bandwidth,
connectionType = Connection.UNKNOWN;
if (!connection) {
setTimeout(function() {
successCallback(connectionType);
}, 0);
return;
}
var bandwidth = connection.bandwidth,
metered = connection.metered,
type = connection.type;
@ -86,4 +94,4 @@ module.exports = {
}
};
require("cordova/exec/proxy").add("NetworkStatus", module.exports);
require("cordova/exec/proxy").add("NetworkStatus", module.exports);