Skip to content

Commit

Permalink
Log Bluetooth availability (#244)
Browse files Browse the repository at this point in the history
  • Loading branch information
microbit-robert committed Feb 29, 2024
1 parent 254bb4c commit 8ceca5b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/script/stores/uiStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import MBSpecs from '../microbit-interfacing/MBSpecs';
import { gestures } from './Stores';
import { HexOrigin } from '../../StaticConfiguration';
import { DeviceRequestStates } from '../microbit-interfacing/MicrobitConnection';
import { logError } from '../utils/logging';
import { logError, logEvent } from '../utils/logging';

// TODO: Rename? Split up further?

Expand All @@ -28,6 +28,11 @@ if (compatibilityResult.bluetooth) {
.getAvailability()
.then(bluetoothAvailable => {
compatibility.update(s => {
logEvent({
type: 'Device',
action: 'Bluetooth available',
value: s.bluetooth && bluetoothAvailable ? 1 : 0,
});
s.bluetooth = s.bluetooth && bluetoothAvailable;
return s;
});
Expand Down

0 comments on commit 8ceca5b

Please sign in to comment.