sidebar: bluetooth device battery no NaN
This commit is contained in:
parent
38197e7ab5
commit
282c8a65c2
1 changed files with 1 additions and 1 deletions
|
|
@ -26,7 +26,7 @@ const BluetoothDevice = (device: AstalBluetooth.Device) => (
|
||||||
const update = () => {
|
const update = () => {
|
||||||
self.label =
|
self.label =
|
||||||
(device.connected ? "Connected" : "Paired") +
|
(device.connected ? "Connected" : "Paired") +
|
||||||
(device.batteryPercentage !== -1 ? ` (${device.batteryPercentage * 100}%)` : "");
|
(device.batteryPercentage >= 0 ? ` (${device.batteryPercentage * 100}%)` : "");
|
||||||
self.visible = device.connected || device.paired;
|
self.visible = device.connected || device.paired;
|
||||||
};
|
};
|
||||||
self.hook(device, "notify::connected", update);
|
self.hook(device, "notify::connected", update);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue