Skip to content

Commit

Permalink
refs #26 Fix scan layout and what data gets shown
Browse files Browse the repository at this point in the history
  • Loading branch information
truedat101 committed Mar 23, 2024
1 parent 12a80f4 commit 394fbee
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions magnet_app/lib/app_state_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ class AppState extends BLEProvider {
if (device.id == deviceId) {
print("--------------> Found match!!!!");
} else {
// XXX TODO: fix database dups
// Create a new document.
final adoc = await _db!.document(device.id);
if (adoc == null) {
Expand All @@ -137,8 +138,10 @@ class AppState extends BLEProvider {
*/
// _genericBleDevices_connected.addIf(!_genericBleDevices_connected.contains(device),device);
// int sz = _devices.length;
_devices.addIf(!_devices.contains(device), {
'id': device.id,

_devices.addIf(!_devices.contains(device) && _devices.every((element) => element['uuid'] != device.id), {
'id': device.id.substring(device.id.length-5),
'uuid': device.id,
'name': device.name,
'type': device.manufacturerData.toString()
});
Expand Down

0 comments on commit 394fbee

Please sign in to comment.