mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Don't be dumb
This commit is contained in:
parent
70052affc4
commit
a8a3dab926
2 changed files with 13 additions and 2 deletions
|
|
@ -259,8 +259,9 @@ func upsertPositionPacket (packet: MeshPacket, context: NSManagedObjectContext)
|
|||
/// Don't save the same position over and over.
|
||||
if mutablePositions.count > 0 {
|
||||
let mostRecent = mutablePositions.lastObject as! PositionEntity
|
||||
if mostRecent.latitudeI == position.latitudeI && mostRecent.longitudeI == position.latitudeI {
|
||||
if mostRecent.latitudeI == position.latitudeI && mostRecent.longitudeI == position.longitudeI {
|
||||
mutablePositions.remove(mostRecent)
|
||||
print("Delete stupid fixed position for \(position.nodePosition)")
|
||||
}
|
||||
}
|
||||
mutablePositions.add(position)
|
||||
|
|
|
|||
|
|
@ -106,7 +106,17 @@ struct MeshMap: View {
|
|||
}
|
||||
.frame(width: 60, height: 60)
|
||||
}
|
||||
CircleText(text: position.nodePosition?.user?.shortName ?? "?", color: Color(nodeColor), circleSize: 40)
|
||||
if position.nodePostion?.hasDetectionSensor ?? false {
|
||||
Image(systemName: "sensor.fill")
|
||||
.symbolRenderingMode(.palette)
|
||||
.symbolEffect(.variableColor)
|
||||
.padding()
|
||||
.foregroundStyle(.white)
|
||||
.background(Color(nodeColor))
|
||||
.clipShape(Circle())
|
||||
} else {
|
||||
CircleText(text: position.nodePosition?.user?.shortName ?? "?", color: Color(nodeColor), circleSize: 40)
|
||||
}
|
||||
}
|
||||
.onTapGesture { location in
|
||||
selectedPosition = (selectedPosition == position ? nil : position)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue