Bluetooth Panel: UI cleanup/factorization

This commit is contained in:
LemmyCook 2025-09-04 23:26:19 -04:00
parent 5910c65bcf
commit cc8a24f445
5 changed files with 135 additions and 187 deletions

View file

@ -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"
}