Settings BT: fix toggle not reactive if no BT adapter

This commit is contained in:
quadbyte 2025-08-07 18:34:48 -04:00
parent 64d7ae2e13
commit ad0d3f4883

View file

@ -69,8 +69,9 @@ ColumnLayout {
description: "Turn Bluetooth radio on or off"
value: Settings.settings.bluetoothEnabled
onToggled: function() {
Settings.settings.bluetoothEnabled = !Settings.settings.bluetoothEnabled;
if (Bluetooth.defaultAdapter) {
Settings.settings.bluetoothEnabled = !Settings.settings.bluetoothEnabled;
Bluetooth.defaultAdapter.enabled = Settings.settings.bluetoothEnabled;
if (Bluetooth.defaultAdapter.enabled)
Bluetooth.defaultAdapter.discovering = true;