Permalink
Browse files

Bug 825017 - [B2G][FTE] The import Facebook contacts button now works…

… correctly

fixes

Fix

Display logic fix in fb-ftu button

Forget the wifi on startup of ftu

cleaning
  • Loading branch information...
1 parent 1172f87 commit 4eff0de923c662b1b1f8548a67e94446ea2fad5f @michalbe michalbe committed Dec 28, 2012
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 4eff0de

Please sign in to comment.