Skip to content
Browse files

bug 818690 don't try to stop discover mode when bluetooth is disabling.

  • Loading branch information...
1 parent 35728c9 commit 566bf2fd1fe4fcc110fa1a1859b95dd4108464ed @evelynhung evelynhung committed
Showing with 4 additions and 2 deletions.
  1. +4 −2 apps/settings/js/bluetooth.js
View
6 apps/settings/js/bluetooth.js
@@ -288,7 +288,9 @@ onLocalized(function bluetoothSettings() {
enableMsg.hidden = false;
searchingItem.hidden = true;
optionMenu.close();
- stopDiscovery();
+ // clear discoverTimeout
+ clearTimeout(discoverTimeout);
+ discoverTimeout = null;
}
}
@@ -544,7 +546,7 @@ onLocalized(function bluetoothSettings() {
}
function stopDiscovery() {
- if (!defaultAdapter)
+ if (!defaultAdapter || !bluetooth.enabled)
return;
var req = defaultAdapter.stopDiscovery();
req.onsuccess = function bt_discoveryStopped() {

0 comments on commit 566bf2f

Please sign in to comment.
Something went wrong with that request. Please try again.