diff --git a/Meshtastic/Views/Helpers/NodeAnnotation.swift b/Meshtastic/Views/Helpers/NodeAnnotation.swift index a8c47579..817448f1 100644 --- a/Meshtastic/Views/Helpers/NodeAnnotation.swift +++ b/Meshtastic/Views/Helpers/NodeAnnotation.swift @@ -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) - } } } diff --git a/Meshtastic/Views/Settings/Config/PositionConfig.swift b/Meshtastic/Views/Settings/Config/PositionConfig.swift index 5fcaa854..f703fcf0 100644 --- a/Meshtastic/Views/Settings/Config/PositionConfig.swift +++ b/Meshtastic/Views/Settings/Config/PositionConfig.swift @@ -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!) diff --git a/Meshtastic/Views/Settings/ShareChannel.swift b/Meshtastic/Views/Settings/ShareChannel.swift index 1d73e7cf..0badf12e 100644 --- a/Meshtastic/Views/Settings/ShareChannel.swift +++ b/Meshtastic/Views/Settings/ShareChannel.swift @@ -69,7 +69,7 @@ struct ShareChannel: View { alignment: .center ) - if node?.loRaConfig != nil { + if node!.loRaConfig != nil { HStack {