Skip to content

Commit

Permalink
🔥 Remove code to build JSON objects
Browse files Browse the repository at this point in the history
In an earlier version of this PR, before I added mocking to the plugin,
we saved JSON objects directly. We created the objects to save by
removing results from the in-memory objects using a destructuring
assignment.

However, after the mocking was added, we create objects in native code.
So we don't need to create them here and can remove these unused
variables.
#1144 (comment)
  • Loading branch information
shankari committed Apr 15, 2024
1 parent 463c2a5 commit 87370b6
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions www/js/bluetooth/BluetoothScanPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ const BluetoothScanPage = ({ ...props }: any) => {
in_range: status,
},
}));
let { monitorResult: _, in_range: _, ...noResultDevice } = sampleBLEDevices[uuid];
window['cordova']?.plugins?.BEMDataCollection.mockBLEObjects(
status ? 'REGION_ENTER' : 'REGION_EXIT',
uuid,
Expand All @@ -118,16 +117,6 @@ const BluetoothScanPage = ({ ...props }: any) => {
rangeResult: result,
},
}));
// we don't want to exclude monitorResult and rangeResult from the values
// that we save because they are the current or previous result, just
// in a different format
// https://stackoverflow.com/a/34710102
let {
monitorResult: _,
rangeResult: _,
in_range: _,
...noResultDevice
} = sampleBLEDevices[uuid];
let parsedResult = JSON.parse(result);
parsedResult.beacons.forEach((beacon) => {
window['cordova']?.plugins?.BEMDataCollection.mockBLEObjects(
Expand Down

0 comments on commit 87370b6

Please sign in to comment.