Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Simplify the way we get wifi relSignalStrength

  • Loading branch information...
commit fd7d244b7751184a97bcffe720199a585f6f0526 1 parent da51528
@timdream timdream authored
Showing with 3 additions and 12 deletions.
  1. +3 −12 apps/system/js/statusbar.js
View
15 apps/system/js/statusbar.js
@@ -268,7 +268,7 @@ var StatusBar = {
},
- wifi: function sb_updateWifi(evt) {
+ wifi: function sb_updateWifi() {
var wifiManager = window.navigator.mozWifiManager;
if (!wifiManager)
return;
@@ -299,17 +299,8 @@ var StatusBar = {
}
icon.hidden = false;
- var relSignalStrength = 0;
- if (evt && evt.relSignalStrength) {
- relSignalStrength = evt.relSignalStrength;
- } else if (wifiManager.connectionInformation &&
- wifiManager.connectionInformation.relSignalStrength) {
- relSignalStrength =
- wifiManager.connectionInformation.relSignalStrength;
- } else {
- console.error(
- 'Status Bar: WIFI is connected but signal strength is unknown.');
- }
+ var relSignalStrength =
+ wifiManager.connectionInformation.relSignalStrength;
icon.dataset.level = Math.floor(relSignalStrength / 25);
},
Please sign in to comment.
Something went wrong with that request. Please try again.