Permalink
Browse files

Merge pull request #7230 from michalbe/fb-button-ftu

Bug 825017 - [B2G][FTE] The import Facebook contacts button now works co...
  • Loading branch information...
2 parents 7b22a34 + 4eff0de commit 2e33b9e86e0e5e7f80990a96fa0760ecf6840738 @michalbe michalbe committed Jan 7, 2013
Showing with 7 additions and 4 deletions.
  1. +1 −1 apps/communications/ftu/js/navigation.js
  2. +6 −3 apps/communications/ftu/js/wifi.js
@@ -198,7 +198,7 @@ var Navigation = {
simOption.classList.add('disabled');
}
// If we have 3G or Wifi activate FB import
- if (WifiManager.isConnected || DataMobile.isDataAvailable) {
+ if (WifiManager.api.connection.status === 'connected' || DataMobile.isDataAvailable) {
fbOption.classList.remove('disabled');
} else {
fbOption.classList.add('disabled');
@@ -7,8 +7,13 @@ var WifiManager = {
this.api = window.navigator.mozWifiManager;
this.changeStatus();
this.gCurrentNetwork = this.api.connection.network;
+ if (this.gCurrentNetwork !== null) {
+ this.api.forget(this.gCurrentNetwork);
+ this.gCurrentNetwork = null;
+ }
}
},
+
isConnectedTo: function wn_isConnectedTo(network) {
/**
* XXX the API should expose a 'connected' property on 'network',
@@ -24,6 +29,7 @@ var WifiManager = {
currentNetwork.capabilities.join('+');
return (key == curkey);
},
+
scan: function wn_scan(callback) {
if ('mozWifiManager' in window.navigator) {
var req = WifiManager.api.getNetworks();
@@ -128,12 +134,9 @@ var WifiManager = {
WifiManager.api.onstatuschange = function(event) {
UIManager.updateNetworkStatus(self.ssid, event.status);
if (event.status == 'connected') {
- self.isConnected = true;
if (self.networks && self.networks.length) {
UIManager.renderNetworks(self.networks);
}
- } else {
- self.isConnected = false;
}
};

0 comments on commit 2e33b9e

Please sign in to comment.