File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -231,9 +231,9 @@ class AccessoryRegistry extends ChangeNotifier {
231231 //Update the latest timestamp
232232 if (decryptedReports.isNotEmpty) {
233233 var lastReport = decryptedReports[decryptedReports.length - 1 ];
234- var oldTs = DateTime ( 1970 ) ;
235- var latestReportTS = lastReport.timestamp ?? DateTime (1971 );
236- if (oldTs.isBefore (latestReportTS)) {
234+ var oldTs = accessory.datePublished ;
235+ var latestReportTS = lastReport.timestamp ?? lastReport.published ?? DateTime (1971 );
236+ if (oldTs == null || oldTs .isBefore (latestReportTS) ) {
237237 //only an actualization if oldTS is not set or is older than the latest of the new ones
238238 accessory.lastLocation =
239239 LatLng (lastReport.latitude! , lastReport.longitude! );
Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ class _ItemFileImportState extends State<ItemFileImport> {
143143 var keyPair = await FindMyController .importKeyPair (accessoryDTO.privateKey);
144144
145145 Accessory newAccessory = Accessory (
146- datePublished: DateTime . now ( ),
146+ datePublished: DateTime ( 1970 ),
147147 hashedPublicKey: keyPair.hashedPublicKey,
148148 id: accessoryDTO.id.toString (),
149149 name: accessoryDTO.name,
You can’t perform that action at this time.
0 commit comments