forked from Shinonome/dots-hyprland
fix(bluetooth): sync toggle state with device connection
This commit is contained in:
@@ -56,9 +56,13 @@ const BluetoothDevice = (device) => {
|
|||||||
onChange: (self, newValue) => {
|
onChange: (self, newValue) => {
|
||||||
device.setConnection(newValue);
|
device.setConnection(newValue);
|
||||||
},
|
},
|
||||||
extraSetup: (self) => self.hook(device, (self) => {
|
extraSetup: (self) => {
|
||||||
Utils.timeout(200, () => self.enabled.value = device.connected);
|
self.hook(device, () => {
|
||||||
}),
|
const enabledState = self.attribute.enabled;
|
||||||
|
if (enabledState.value !== device.connected)
|
||||||
|
enabledState.value = device.connected;
|
||||||
|
});
|
||||||
|
},
|
||||||
})
|
})
|
||||||
const deviceRemoveButton = Button({
|
const deviceRemoveButton = Button({
|
||||||
vpack: 'center',
|
vpack: 'center',
|
||||||
|
|||||||
Reference in New Issue
Block a user