Skip to content

Commit

Permalink
Fix last seen point
Browse files Browse the repository at this point in the history
  • Loading branch information
wangwillian0 committed Aug 31, 2023
1 parent ba0b193 commit 680af0b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/accessory/accessory_registry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ class AccessoryRegistry extends ChangeNotifier {
))
.toList();

reports.sort((a, b) => (b.timestamp ?? DateTime(0)).compareTo(a.timestamp ?? DateTime(0)));

if (reports.isNotEmpty) {
var lastReport = reports.first;
accessory.lastLocation = LatLng(lastReport.latitude, lastReport.longitude);
Expand Down
1 change: 1 addition & 0 deletions lib/findMy/decrypt_reports.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class DecryptReports {
final decryptedLocationChunk = reportChunk.mapIndexed((index, report) {
final derivedKey = _kdf(sharedKeyChunk[index], ephemeralKeyChunk[index]);
final payloadData = report.payload;
_decodeTimeAndConfidence(payloadData, report);
final encData = payloadData.sublist(62, 72);
final tag = payloadData.sublist(72, payloadData.length);
final decryptedPayload = _decryptPayload(encData, derivedKey, tag);
Expand Down

0 comments on commit 680af0b

Please sign in to comment.