mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
Fix Bluetooth auto-connect not working on startup
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user