mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Sort positions the same way on both maps so we can get latest
This commit is contained in:
parent
243dd75456
commit
f7f09c6705
2 changed files with 2 additions and 2 deletions
|
|
@ -125,7 +125,7 @@ struct MapViewSwiftUI: UIViewRepresentable {
|
|||
annotationView.canShowCallout = true
|
||||
annotationView.glyphText = "📟"
|
||||
|
||||
let latest = parent.positions.first(where: { $0.nodePosition?.num ?? 0 == positionAnnotation.nodePosition?.num ?? -1 })
|
||||
let latest = parent.positions.last(where: { $0.nodePosition?.num ?? 0 == positionAnnotation.nodePosition?.num ?? -1 })
|
||||
|
||||
if latest == positionAnnotation {
|
||||
annotationView.markerTintColor = .systemRed
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ struct NodeMap: View {
|
|||
}
|
||||
}
|
||||
//&& nodePosition != nil
|
||||
@FetchRequest(sortDescriptors: [NSSortDescriptor(key: "time", ascending: false)],
|
||||
@FetchRequest(sortDescriptors: [NSSortDescriptor(key: "time", ascending: true)],
|
||||
predicate: NSPredicate(format: "time >= %@ && nodePosition != nil", Calendar.current.startOfDay(for: Date()) as NSDate), animation: .none)
|
||||
private var positions: FetchedResults<PositionEntity>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue