Skip to content

Commit 8ceca5b

Browse files
Log Bluetooth availability (#244)
1 parent 254bb4c commit 8ceca5b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/script/stores/uiStore.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import MBSpecs from '../microbit-interfacing/MBSpecs';
1414
import { gestures } from './Stores';
1515
import { HexOrigin } from '../../StaticConfiguration';
1616
import { DeviceRequestStates } from '../microbit-interfacing/MicrobitConnection';
17-
import { logError } from '../utils/logging';
17+
import { logError, logEvent } from '../utils/logging';
1818

1919
// TODO: Rename? Split up further?
2020

@@ -28,6 +28,11 @@ if (compatibilityResult.bluetooth) {
2828
.getAvailability()
2929
.then(bluetoothAvailable => {
3030
compatibility.update(s => {
31+
logEvent({
32+
type: 'Device',
33+
action: 'Bluetooth available',
34+
value: s.bluetooth && bluetoothAvailable ? 1 : 0,
35+
});
3136
s.bluetooth = s.bluetooth && bluetoothAvailable;
3237
return s;
3338
});

0 commit comments

Comments
 (0)