Fix Bluetooth auto-connect not working on startup

This commit is contained in:
notiant
2026-03-04 20:23:39 +01:00
committed by GitHub
parent c9b6fc9ef9
commit ff0297d56e
+4 -16
View File
@@ -79,13 +79,6 @@ Singleton {
}
}
Timer {
id: initDelayTimer
interval: 3000
running: true
repeat: false
}
Timer {
id: autoConnectTimer
interval: 2000
@@ -104,10 +97,8 @@ Singleton {
Quickshell.execDetached(["rfkill", "block", "wifi"]);
Quickshell.execDetached(["rfkill", "block", "bluetooth"]);
}
// Auto-connect on startup if BT is already enabled
if (Settings.data.network.bluetoothAutoConnect && adapter && adapter.enabled) {
autoConnectTimer.restart();
}
// Auto-connect on startup
autoConnectTimer.restart();
}
// Handle system wakeup to force-poll and ensure state is up-to-date
@@ -625,12 +616,9 @@ Singleton {
}
function attemptAutoConnect() {
if (airplaneModeEnabled)
return;
if (!adapter || !adapter.enabled)
return;
if (!Settings.data.network.bluetoothAutoConnect)
if (airplaneModeEnabled || !adapter || !adapter.enabled || !Settings.data.network.bluetoothAutoConnect) {
return;
}
var devList = adapter.devices.values.filter(function (dev) {
return dev && dev.paired && !dev.connected && !dev.blocked;