mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
* Add unknown time logic to pins on node details view
* send current position if fixed position is enabled on position config * check for nil loRaConfig on share channel view
This commit is contained in:
parent
8e06a917b3
commit
bd92aae2eb
3 changed files with 29 additions and 12 deletions
|
|
@ -3,15 +3,31 @@ import SwiftUI
|
|||
|
||||
struct NodeAnnotation: View {
|
||||
let time: Date
|
||||
|
||||
let sixMonthsAgo = Calendar.current.date(byAdding: .month, value: -6, to: Date())
|
||||
|
||||
var body: some View {
|
||||
|
||||
VStack(spacing: 0) {
|
||||
Text(time, style: .offset)
|
||||
.font(.callout).foregroundColor(.accentColor)
|
||||
.padding(5)
|
||||
.background(Color(.white))
|
||||
.cornerRadius(10)
|
||||
if (time >= sixMonthsAgo!) {
|
||||
|
||||
VStack(spacing: 0) {
|
||||
Text(time, style: .offset)
|
||||
.font(.caption2).foregroundColor(.accentColor)
|
||||
.padding(5)
|
||||
.background(Color(.white))
|
||||
.cornerRadius(10)
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
VStack(spacing: 0) {
|
||||
Text("Unknown Time")
|
||||
.font(.caption2).foregroundColor(.accentColor)
|
||||
.padding(5)
|
||||
.background(Color(.white))
|
||||
.cornerRadius(10)
|
||||
}
|
||||
}
|
||||
|
||||
Image(systemName: "mappin.circle.fill")
|
||||
.font(.largeTitle)
|
||||
|
|
@ -21,6 +37,5 @@ struct NodeAnnotation: View {
|
|||
.font(.caption)
|
||||
.foregroundColor(.accentColor)
|
||||
.offset(x: 0, y: -5)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -113,12 +113,9 @@ struct PositionConfig: View {
|
|||
Label("Fixed Position", systemImage: "location.square.fill")
|
||||
}
|
||||
.toggleStyle(SwitchToggleStyle(tint: .accentColor))
|
||||
if fixedPosition {
|
||||
|
||||
Text("Set to current location here")
|
||||
Text("If enabled your current location will be set as a fixed position.")
|
||||
.font(.caption)
|
||||
.listRowSeparator(.visible)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -255,6 +252,11 @@ struct PositionConfig: View {
|
|||
if includePosHeading { pf.insert(.posHeading) }
|
||||
|
||||
pc.positionFlags = UInt32(pf.rawValue)
|
||||
|
||||
if fixedPosition {
|
||||
|
||||
let sendPosition = bleManager.sendPosition(destNum: bleManager.connectedPeripheral.num, wantAck: true)
|
||||
}
|
||||
|
||||
let adminMessageId = bleManager.savePositionConfig(config: pc, fromUser: node!.user!, toUser: node!.user!)
|
||||
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ struct ShareChannel: View {
|
|||
alignment: .center
|
||||
)
|
||||
|
||||
if node?.loRaConfig != nil {
|
||||
if node!.loRaConfig != nil {
|
||||
|
||||
HStack {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue