[AGS] Fix Bluetooth crashes
This commit is contained in:
@@ -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 (_) { }
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
$fg-color: #E6E6E6;
|
||||
$bg-color: #141414;
|
||||
$accent-color: #B27BD1;
|
||||
$accent-color-2: #5F50A6;
|
||||
$accent-color: #040E1D;
|
||||
$accent-color-2: #0868BA;
|
||||
|
Reference in New Issue
Block a user