[AGS] Fix Bluetooth crashes

This commit is contained in:
2025-04-26 09:38:15 +02:00
parent 33fcdd72f7
commit e19a1179d5
9 changed files with 54 additions and 35 deletions

View File

@@ -114,15 +114,26 @@ const openBTPicker = () => {
};
const BluetoothPickerList = () => {
let btEnableState = readFile("./btconf") === "true" ? true : false;
let btEnableState = false;
try {
btEnableState = readFile("./btconf") === "true" ? true : false;
} catch (_) { }
if (bt.get_adapter()) {
print( 'Setting BT state to ' + btEnableState );
print('Setting BT state to ' + btEnableState);
bt.adapter.set_powered(btEnableState);
} else {
timeout(5000, () => {
if (bt.get_adapter()) {
print( 'Setting BT state to ' + btEnableState );
print('Setting BT state to ' + btEnableState);
bt.adapter.set_powered(btEnableState);
} else {
timeout(5000, () => {
try {
bt.adapter.set_powered(btEnableState);
} catch (_) { }
})
}
})
}

View File

@@ -1,4 +1,4 @@
$fg-color: #E6E6E6;
$bg-color: #141414;
$accent-color: #B27BD1;
$accent-color-2: #5F50A6;
$accent-color: #040E1D;
$accent-color-2: #0868BA;