Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Bug 880157 - Update the name if available #10239

Merged
merged 1 commit into from Jun 17, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 13 additions & 2 deletions apps/settings/js/bluetooth.js
Expand Up @@ -480,9 +480,20 @@ navigator.mozL10n.ready(function bluetoothSettings() {
// callback function when an avaliable device found
function onDeviceFound(evt) {
var device = evt.device;
// ignore duplicate and paired device
if (openList.index[device.address] || pairList.index[device.address])
// Ignore duplicate and paired device. Update the name if needed.
var existingDevice = openList.index[device.address] ||
pairList.index[device.address];
if (existingDevice) {
var existingItem = existingDevice[1];
if (device.name && existingItem) {
var deviceName = existingItem.querySelector('a');
if (deviceName) {
deviceName.dataset.l10nId = '';
deviceName.textContent = device.name;
}
}
return;
}

var aItem = newListItem(device, 'device-status-tap-connect');

Expand Down