From 6ca810d2927d94f069bf8a6c4234445b89a5cabe Mon Sep 17 00:00:00 2001 From: "K. Shankari" Date: Thu, 11 Apr 2024 10:21:19 -0700 Subject: [PATCH] Prettier fixes + highlight that the buttons simulate behavior The simulation buttons are white text on a red background --- www/js/bluetooth/BluetoothCard.tsx | 17 ++++++++++++----- www/js/bluetooth/BluetoothScanPage.tsx | 2 +- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/www/js/bluetooth/BluetoothCard.tsx b/www/js/bluetooth/BluetoothCard.tsx index d3361badc..8675f8179 100644 --- a/www/js/bluetooth/BluetoothCard.tsx +++ b/www/js/bluetooth/BluetoothCard.tsx @@ -42,13 +42,15 @@ const BluetoothCard = ({ device, isClassic, isScanningBLE }: Props) => { deviceWithBeacons.monitorResult = undefined; deviceWithBeacons.rangeResult = undefined; deviceWithBeacons.beacons = [ - {uuid: device.uuid, + { + uuid: device.uuid, major: device.major | 4567, minor: device.minor | 1945, - proximity: "ProximityNear", + proximity: 'ProximityNear', accuracy: Math.random() * 1.33, - rssi: Math.random() * -62} - ] + rssi: Math.random() * -62, + }, + ]; deviceWithBeacons.minor = device.minor | 4567; deviceWithBeacons.minor = device.minor | 4567; window['cordova'].plugins.locationManager.getDelegate().didRangeBeaconsInRegion({ @@ -73,7 +75,12 @@ const BluetoothCard = ({ device, isClassic, isScanningBLE }: Props) => { {device.rangeResult} - + + Simulate by sending UI transitions + + diff --git a/www/js/bluetooth/BluetoothScanPage.tsx b/www/js/bluetooth/BluetoothScanPage.tsx index 435a7c4de..d94b01597 100644 --- a/www/js/bluetooth/BluetoothScanPage.tsx +++ b/www/js/bluetooth/BluetoothScanPage.tsx @@ -90,7 +90,7 @@ const BluetoothScanPage = ({ ...props }: any) => { ...prevDevices, [uuid]: { ...prevDevices[uuid], - monitorResult: status? result : undefined, + monitorResult: status ? result : undefined, rangeResult: undefined, in_range: status, },