Bluetooth Panel: UI cleanup/factorization
This commit is contained in:
parent
5910c65bcf
commit
cc8a24f445
5 changed files with 135 additions and 187 deletions
|
|
@ -107,13 +107,21 @@ Singleton {
|
|||
return device.connected && !device.pairing && !device.blocked
|
||||
}
|
||||
|
||||
function getSignalStrength(device) {
|
||||
function getStatusString(device) {
|
||||
if (device.state === BluetoothDeviceState.Connecting) {
|
||||
return "Connecting..."
|
||||
}
|
||||
if (device.pairing) {
|
||||
return "Pairing..."
|
||||
}
|
||||
if (device.blocked) {
|
||||
return "Blocked"
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
|
||||
function getSignalStrength(device) {
|
||||
if (!device || device.signalStrength === undefined || device.signalStrength <= 0) {
|
||||
return "Signal: Unknown"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue