Permalink
Browse files

Switched from strings to Constants defined in Connection for connecti…

…on type
  • Loading branch information...
ghtomcat authored and hermwong committed Nov 22, 2012
1 parent 75f2fa6 commit f29591f869db25f7fa52766e4ac5b60ced38a59f
Showing with 5 additions and 4 deletions.
  1. +5 −4 lib/webos/plugin/webos/network.js
@@ -19,7 +19,8 @@
*
*/
-var service=require('cordova/plugin/webos/service');
+var service=require('cordova/plugin/webos/service'),
+ Connection = require('cordova/plugin/Connection');
module.exports = {
/**
@@ -39,9 +40,9 @@ module.exports = {
console.log("result:"+JSON.stringify(result));
var info={};
- if (!result.isInternetConnectionAvailable) { info.type="Connection.NONE"; }
- if (result.wifi.onInternet) { info.type="Connection.WIFI"; }
- if (result.wan.state==="connected") { info.type="Connection.CELL_2G"; }
+ if (!result.isInternetConnectionAvailable) { info.type=Connection.NONE; }
+ if (result.wifi.onInternet) { info.type=Connection.WIFI; }
+ if (result.wan.state==="connected") { info.type=Connection.CELL_2G; }
successCallback(info.type);
},

0 comments on commit f29591f

Please sign in to comment.